GH-89727: Fix `os.fwalk()` recursion error on deep trees by barneygale · Pull Request #119638 · python/cpython · GitHub

github.com

Tin mới

barneygale:gh-89727-os-fwalk

miss-islington-app

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

Change shutil.rmtree and os.walk to support very deep hierarchies #89727

GH-89727: Fix `os.fwalk()` recursion error on deep trees Implement `os.fwalk()` using a list as a stack to avoid emitting recursion errors on deeply nested trees.

needs backport to 3.12

needs backport to 3.13

awaiting core review

View reviewed changes

De-duplicate stat()ing

Defer DirEntry.stat()

Fix tests, line length.

Simplify handling of root dir slightly.

Simplify some naming, tuple unpacking.

Merge similar walk actions.

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

Merge branch 'main' into

recursion error on deep trees (

recursion error on deep trees (

bedevere-app Bot commented May 30, 2024
bedevere-app Bot commented May 30, 2024

bedevere-app Bot commented May 30, 2024

GH-119764 is a backport of this pull request to the 3.13 branch.

recursion error on deep trees (

recursion error on deep trees (

gh-89727: Fix os.fwalk RecursionError on deep trees #100347

GH-89727: Fix `os.fwalk()` recursion error on deep trees (#119638) Implement `os.fwalk()` using a list as a stack to avoid emitting recursion errors on deeply nested trees.

GH-89727: Fix `os.fwalk()` recursion error on deep trees (#119638) Implement `os.fwalk()` using a list as a stack to avoid emitting recursion errors on deeply nested trees.