gh-89727: Fix os.walk to handle late editing of dirs by jonburdo · Pull Request #100703 · python/cpython · GitHub

github.com

Tin mới

jonburdo:os-walk-dirs-editing

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

adopt old os.walk behavior to handle changes to dirs list after itera…

move stack logic to bottom of loop in os.walk

move scandir logic to bottom of loop

use for-loop to process dirs in bottom-up clause

Merge branch 'main' into os-walk-dirs-editing

return if scandir_it fails on first value

add test for late modification of dirs in os.walk

Merge branch 'main' into os-walk-dirs-editing

use while-else instead of while True, make variable names clearer

change os.walk docstring to say "traverse" instead of "recurse"

View reviewed changes

Learn more about hiding disruptive comments

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

fix scandir comment

Merge branch 'main' into os-walk-dirs-editing

split topdown and bottomup logic into separate functions for os.walk

View reviewed changes

os.walk() no longer supports late edits to dirnames #102932

Merge branch 'main' into os-walk-dirs-editing