Skip to content

Conversation

@barneygale
Copy link
Contributor

@barneygalebarneygale commented Apr 15, 2023

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()`.
@barneygale
Copy link
ContributorAuthor

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)

Sign up for freeto 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

@barneygale@bedevere-bot