← 返回首页
GH-89727: Add `pathlib.Path.fwalk()` method by barneygale · Pull Request #103566 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

GH-89727: Add pathlib.Path.fwalk() method#103566

Closed
barneygale wants to merge 3 commits into
python:mainfrom
barneygale:pathlib-fwalk2
Closed

GH-89727: Add pathlib.Path.fwalk() method#103566
barneygale wants to merge 3 commits into
python:mainfrom
barneygale:pathlib-fwalk2

Conversation

barneygale commented Apr 15, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Add pathlib.Path.fwalk() method, which behaves exactly like Path.walk() except that it yields a 4-tuple (dirpath, dirnames, filenames, dirfd), and it supports a dir_fd.

This method provides safety from symlink attacks when walking directory trees; this is important for implementing functionality such as rmtree().

Add `pathlib.Path.fwalk()` method, which behaves exactly like `Path.walk()` except that it yields a 4-tuple `(dirpath, dirnames, filenames, dirfd)`, and it supports a `dir_fd`. This method provides safety from symlink attacks when walking directory trees; this is important for implementing functionality such as `rmtree()`.

Copy link
Copy Markdown
Contributor Author

Withdrawing this PR - it's out of date, and I'd like to keep the Path API stable until PathBase is made public (see #110109)

barneygale closed this Nov 22, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Footer

© 2026 GitHub, Inc.