Repository navigation
Change shutil.rmtree and os.walk to support very deep hierarchies #89727
Copy link
Copy link
Open
Labels
3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
| BPO | 45564 |
|---|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2021-10-21.22:21:02.146>
labels = ['library', '3.9', 'type-crash']
title = 'shutil.rmtree and os.walk are implemented using recursion, fail on deep hierarchies'
updated_at = <Date 2021-10-21.22:21:02.146>
user = 'https://bugs.python.org/AlexanderPatrakov'bugs.python.org fields:
activity = <Date 2021-10-21.22:21:02.146>
actor = 'Alexander.Patrakov'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-10-21.22:21:02.146>
creator = 'Alexander.Patrakov'
dependencies = []
files = []
hgrepos = []
issue_num = 45564
keywords = []
message_count = 1.0
messages = ['404687']
nosy_count = 1.0
nosy_names = ['Alexander.Patrakov']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue45564'
versions = ['Python 3.9']Linked PRs
- gh-89727: Fix os.walk RecursionError on deep trees #99803
- gh-89727: Fix pathlib.Path.walk RecursionError on deep trees #100282
- gh-89727: Fix os.fwalk RecursionError on deep trees #100347
- gh-89727: Improve os.walk complexity and speed #100671
- gh-89727: Fix os.walk to handle late editing of dirs #100703
- [WIP] GH-89727: Fix
shutil.rmtree()recursion error on deep trees. #103164 - gh-89727: add os.walkdir and os.fwalkdir #103234
- GH-89727: Add
pathlib.Path.fwalk()method #103566 - GH-89727: Partially fix
shutil.rmtree()recursion error on deep trees #119634 - GH-89727: Fix
os.fwalk()recursion error on deep trees #119638 - [3.13] GH-89727: Partially fix
shutil.rmtree()recursion error on deep trees (GH-119634) #119748 - [3.12] GH-89727: Partially fix
shutil.rmtree()recursion error on deep trees (GH-119634) #119749 - [3.13] GH-89727: Fix
os.fwalk()recursion error on deep trees (GH-119638) #119764 - [3.12] GH-89727: Fix
os.fwalk()recursion error on deep trees (GH-119638) #119765 - GH-89727: Fix FD leak on
os.fwalk()generator finalization. #119766 - [3.13] GH-89727: Fix FD leak on
os.fwalk()generator finalization. (GH-119766) #119767 - [3.12] GH-89727: Fix FD leak on
os.fwalk()generator finalization. (GH-119766) #119768 - GH-89727: Fix
shutil.rmtree()recursion error on deep trees #119808 - [3.13] GH-89727: Fix
shutil.rmtree()recursion error on deep trees (GH-119808) #119918 - [3.12] GH-89727: Fix
shutil.rmtree()recursion error on deep trees (GH-119808) #119919
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Activity
AlexanderPatrakov commentedon Oct 21, 2021
It is possible to create deep directory hierarchies that cannot be removed via shutil.rmtree or walked via os.walk, because these functions exceed the interpreter recursion limit. This may have security implications for web services (e.g. various webdisks) that have to clean up user-created mess or walk through it.
pythongh-89727: Fix os.walk RecursionError on deep trees
pythongh-89727: Fix os.walk RecursionError on deep trees
barneygale commentedon Nov 27, 2022
This also affects
pathlib.Path.walk()pythongh-89727: Fix os.walk RecursionError on deep trees
pythongh-89727: Fix os.walk RecursionError on deep trees
Merge branch 'main' into pythongh-89727/fix-pathlib.Path.walk-recursi…
101 remaining items
GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (#119808)
pythonGH-89727: Fix `shutil.rmtree()` recursion error on deep trees (p…
pythonGH-89727: Fix `shutil.rmtree()` recursion error on deep trees (p…
[3.12] pythonGH-89727: Fix `shutil.rmtree()` recursion error on deep …
[3.13] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (G…
[3.12] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (G…
pythonGH-89727: Fix `shutil.rmtree()` recursion error on deep trees (p…
pythonGH-89727: Partially fix `shutil.rmtree()` recursion error on de…
pythonGH-89727: Fix `os.fwalk()` recursion error on deep trees (pytho…
pythonGH-89727: Fix FD leak on `os.fwalk()` generator finalization. (p…
pythonGH-89727: Fix `shutil.rmtree()` recursion error on deep trees (p…
pythonGH-89727: Partially fix `shutil.rmtree()` recursion error on de…
pythonGH-89727: Fix `os.fwalk()` recursion error on deep trees (pytho…
pythonGH-89727: Fix FD leak on `os.fwalk()` generator finalization. (p…
pythonGH-89727: Fix `shutil.rmtree()` recursion error on deep trees (p…