[WIP] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees. by barneygale · Pull Request #103164 · python/cpython · GitHub

github.com

Tin mới

barneygale:pathlib-fwalk

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

recursion error on deep trees.

awaiting core review

Delay urllib import

Fix up filenames in exceptions

Restore shutil._rmtree_islink()

Tidy up exception handling

Better compatibility with shutil tests.

Move main implementation into pathlib

Make _fwalk() private, tidy up naming.

Fix missing filename in exception, tidy up more naming.

Performance improvements

Simplify rmtree (h/t eryksun)

More performance tweaks

Make error._func private, as it's only intended for shutil.rmtree()

Improve performance

Merge branch 'main' into pathlib-fwalk

Supply relative paths to rmdir() in fd-based walk.

Handle rmdir() and unlink() not accepting dir_fd

Move rmtree() implementation back into shutil.

Restore missing dir_fd check

Remove unnecessary change to test

Reduce memory usage a bit.

View reviewed changes