Skip to content

Handle OSError exception #138

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

Merged
merged 1 commit into from
Mar 6, 2025
Merged

Handle OSError exception #138

merged 1 commit into from
Mar 6, 2025

Conversation

ffontaine
Copy link
Contributor

@ffontaine ffontaine commented Mar 5, 2025

Handle PermissionError which can be returned by os.scandir

@Wenzel
Copy link
Owner

Wenzel commented Mar 5, 2025

@ffontaine thanks for this PR
I just fixed the CI
can you rebase ?

@ffontaine
Copy link
Contributor Author

Done

yield from walk_filepath_list([Path(f)], recursive)
else:
yield from (Path(f) for f in os.scandir(path))
except PermissionError:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should catch OSError here for a more comprehensive approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Handle OSError which can be returned by os.scandir

Signed-off-by: Fabrice Fontaine <[email protected]>
@ffontaine ffontaine changed the title Handle PermissionError exception Handle OSError exception Mar 6, 2025
@Wenzel Wenzel merged commit 265d45c into Wenzel:master Mar 6, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants