]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (GH-119808)...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 1 Jun 2024 19:38:55 +0000 (21:38 +0200)
committerGitHub <noreply@github.com>
Sat, 1 Jun 2024 19:38:55 +0000 (20:38 +0100)
commit225c3cd6c1b2e768f1c879c271b48ec27a99cb5b
treec161ec6c2803854029c2e21966e33e422e5fbd44
parent99d0f51e61b6ab3d58c034c007b5d9d6156fdf3b
[3.13] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (GH-119808) (#119918)

Implement `shutil._rmtree_safe_fd()` using a list as a stack to avoid emitting recursion errors on deeply nested trees.

`shutil._rmtree_unsafe()` was fixed in a150679f90.

(cherry picked from commit 53b1981fb0cda6c656069e992f172fc6aad7c99c)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Lib/shutil.py
Lib/test/test_shutil.py
Misc/NEWS.d/next/Library/2024-05-30-21-37-05.gh-issue-89727.D6S9ig.rst [new file with mode: 0644]