← 返回首页
gh-89727: add os.walkdir and os.fwalkdir by jonburdo · Pull Request #103234 · 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 os.walkdir and os.fwalkdir#103234

Closed
jonburdo wants to merge 4 commits into
python:mainfrom
jonburdo:walkdir
Closed

gh-89727: add os.walkdir and os.fwalkdir#103234
jonburdo wants to merge 4 commits into
python:mainfrom
jonburdo:walkdir

Conversation

jonburdo commented Apr 4, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

Add os.walkdir and os.fwalkdir, similar to os.walk and os.fwalk except they return os.DirEntry objects instead of string paths. They also handle symlinks to directories by putting them in nondirs rather than dirs if follow_links=False - like Path.walk rather than os.walk.

TODO:

  • also return os.DirEntry for the first root directory (the top passed in)
  • add follow_junctions=True kwarg
  • support dir editing with generator.send

possible additional steps based on #89727 (comment) :

  • move functions to os.path
  • make on_error work more similarly to shutil.rmtree's onerror

jonburdo closed this Mar 17, 2025
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.