mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[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 ina150679f90
. (cherry picked from commit53b1981fb0
)
This commit is contained in:
parent
60393f5f14
commit
feb7870b46
3 changed files with 64 additions and 89 deletions
|
@ -686,7 +686,6 @@ class TestRmTree(BaseTest, unittest.TestCase):
|
|||
shutil.rmtree(TESTFN)
|
||||
self.assertFalse(os.path.exists(TESTFN))
|
||||
|
||||
@unittest.skipIf(shutil._use_fd_functions, "fd-based functions remain unfixed (GH-89727)")
|
||||
def test_rmtree_above_recursion_limit(self):
|
||||
recursion_limit = 40
|
||||
# directory_depth > recursion_limit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue