]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (GH-119808)...
authorBarney Gale <barney.gale@gmail.com>
Sat, 1 Jun 2024 19:39:35 +0000 (20:39 +0100)
committerGitHub <noreply@github.com>
Sat, 1 Jun 2024 19:39:35 +0000 (20:39 +0100)
commitfeb7870b46feb4b758203a27deab7d674f19923b
tree5fafe204e26eb28048b222b1da4e57085055bf55
parent60393f5f14c7741930de73c46475c9b5c1809dc3
[3.12] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (GH-119808) (#119919)

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)
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]