]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 29 May 2024 20:41:03 +0000 (22:41 +0200)
committerGitHub <noreply@github.com>
Wed, 29 May 2024 20:41:03 +0000 (20:41 +0000)
commit061abf8e4c1a0a920067aa73b0e41f40c89e340b
tree9a96ab7b452d756255902c34e235ff2bc61ff579
parentc3cfc04a736111cb61883cef08469ea46f86d9ce
[3.13] GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (GH-119634) (#119748)

GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (GH-119634)

Make `shutil._rmtree_unsafe()` call `os.walk()`, which is implemented
without recursion.

`shutil._rmtree_safe_fd()` is not affected and can still raise a recursion
error.

(cherry picked from commit a150679f90c6e3f017bd75cac3b8f727063cc4aa)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Lib/os.py
Lib/shutil.py
Lib/test/test_shutil.py
Misc/NEWS.d/next/Library/2024-05-29-20-42-17.gh-issue-89727.5lPTTW.rst [new file with mode: 0644]