Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-89727: add os.walkdir and os.fwalkdir #103234

Closed
wants to merge 4 commits into from
Closed

Conversation

jonburdo
Copy link
Contributor

@jonburdo jonburdo commented Apr 4, 2023

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