]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-90208: Suppress OSError exceptions from `pathlib.Path.glob()` (GH-104141)
authorBarney Gale <barney.gale@gmail.com>
Thu, 11 May 2023 00:01:39 +0000 (01:01 +0100)
committerGitHub <noreply@github.com>
Thu, 11 May 2023 00:01:39 +0000 (01:01 +0100)
commit94f30c75576bb8a20724b2ac758fa33af089a522
treee6c33824c353d12ff76eafd1af69d1d2aa834760
parent373bca0cc5256dc512ffc22bdff4424f7ee8baa2
GH-90208: Suppress OSError exceptions from `pathlib.Path.glob()` (GH-104141)

`pathlib.Path.glob()` now suppresses all OSError exceptions, except
those raised from calling `is_dir()` on the top-level path.

Previously, `glob()` suppressed ENOENT, ENOTDIR, EBADF and ELOOP
errors and their Windows equivalents. PermissionError was also
suppressed unless it occurred when calling `is_dir()` on the
top-level path. However, the selector would abort prematurely
if a PermissionError was raised, and so `glob()` could return
incomplete results.
Lib/pathlib.py
Lib/test/test_pathlib.py
Misc/NEWS.d/next/Library/2023-05-03-19-22-24.gh-issue-90208.tI00da.rst [new file with mode: 0644]