[3.12] GH-89727: Fix os.fwalk() recursion error on deep trees (GH-119638) (#119765)

GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638)

Implement `os.fwalk()` using a list as a stack to avoid emitting recursion
errors on deeply nested trees.
(cherry picked from commit 3c890b503c)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-05-30 05:32:14 +02:00 committed by GitHub
parent 681d7da144
commit aae371bda4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 55 additions and 39 deletions

View file

@ -1673,8 +1673,6 @@ class FwalkTests(WalkTests):
# fwalk() keeps file descriptors open
test_walk_many_open_files = None
# fwalk() still uses recursion
test_walk_above_recursion_limit = None
class BytesWalkTests(WalkTests):