FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-119169: Simplify `os.fwalk()` exception handling by barneygale · Pull Request #121432 · python/cpython · GitHub

/ cpython Public

GH-119169: Simplify os.fwalk() exception handling - #121432

Open
barneygale wants to merge 3 commits into
python:mainfrom
barneygale:os-fwalk-speedup
Open

GH-119169: Simplify os.fwalk() exception handling#121432
barneygale wants to merge 3 commits into
python:mainfrom
barneygale:os-fwalk-speedup

Conversation

barneygale commented Jul 6, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

os.DirEntry.is_dir() already returns false when a file disappears, so the is_symlink() call is redundant. This brings fwalk()'s exception handling more in line with walk().

Handle "disappearing" files as in `walk()`: add them to the `nondirs` list
rather than omitting them entirely.
barneygale added the performance Performance or resource usage label Jul 6, 2024
barneygale changed the title GH-119169: Slightly speed up os.fwalk() GH-119169: Slightly os.fwalk() exception handling Jul 6, 2024
barneygale changed the title GH-119169: Slightly os.fwalk() exception handling GH-119169: Simplify os.fwalk() exception handling Jul 6, 2024

Copy link
Copy Markdown
Member

What if is_dir() fails for other reason? For example, what will happen if the filesystem is unmounted or removable storage is removed or connection fails for NFS? I have doubt that stat() will simply return ENOENT in these cases.

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 17, 2026
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

Labels

awaiting core review performance Performance or resource usage stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL