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

glob crash on permission denied #551

Open
mkrugly opened this issue Sep 14, 2022 · 0 comments
Open

glob crash on permission denied #551

mkrugly opened this issue Sep 14, 2022 · 0 comments

Comments

@mkrugly
Copy link

mkrugly commented Sep 14, 2022

from fs.osfs import OSFS
loc = OSFS('/')
for i in loc.glob('/my_glob/pattern/*'):
   print(i.path)

osfs.py", line 489, in _scandir
    scandir_iter = scandir(sys_path)
PermissionError: [WinError 5] Access is denied:

There seems to be no way to ignore errors in case of fs.glob in oppose to the fs.walk which has an ignore_errors attribute.
This reduces the usability of fs.glob comparing to the python's glob module (which ignores permission denied error).

Would it be possible to introduce the ignore_errors flag, just like in the fs.walk or is there a good reason not to?

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

No branches or pull requests

1 participant