You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pathlib.[r]glob fails when the toplevel directory is not readable, whereas glob.glob "succeeds" #78988
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2018-09-26.08:36:33.686>labels= ['3.7', 'library']
title='pathlib.[r]glob fails when the toplevel directory is not readable, whereas glob.glob "succeeds"'updated_at=<Date2018-09-26.12:43:56.029>user='https://github.com/anntzer'
I'm not arguing that pathlib should reproduce glob's behavior (in fact I think raising an exception is better in this case), but this could be better documented (os.walk does indicate that "By default, errors from the scandir() call are ignored." whereas I don't think either glob or pathlib docs mention this point at all).
Activity
anntzer commentedon Sep 26, 2018
After
$ mkdir -p foo/bar && chmod 000 fooone gets
but
gives a PermissionError.
I'm not arguing that pathlib should reproduce glob's behavior (in fact I think raising an exception is better in this case), but this could be better documented (os.walk does indicate that "By default, errors from the scandir() call are ignored." whereas I don't think either glob or pathlib docs mention this point at all).
Compare with https://bugs.python.org/issue24120, which relates to unreadable directories found *inside* the toplevel directory.
pythonGH-78988: Document `pathlib.Path.glob()` exception propagation.
GH-78988: Document `pathlib.Path.glob()` exception propagation. (#114036
pythonGH-78988: Document `pathlib.Path.glob()` exception propagation. (…
[3.12] pythonGH-78988: Document `pathlib.Path.glob()` exception propa…
[3.12] GH-78988: Document `pathlib.Path.glob()` exception propagation. (
pythonGH-78988: Document `pathlib.Path.glob()` exception propagation. (…
pythonGH-78988: Document `pathlib.Path.glob()` exception propagation. (…
pythonGH-78988: Document `pathlib.Path.glob()` exception propagation. (…