Skip to content
New issue

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

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

Already on GitHub? # to your account

Handle OSError exception #138

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 <fontaine.fabrice@gmail.com>
@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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants