summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2023-05-11 00:01:39 (GMT)
committerGitHub <noreply@github.com>2023-05-11 00:01:39 (GMT)
commit94f30c75576bb8a20724b2ac758fa33af089a522 (patch)
treee6c33824c353d12ff76eafd1af69d1d2aa834760 /Misc
parent373bca0cc5256dc512ffc22bdff4424f7ee8baa2 (diff)
downloadcpython-94f30c75576bb8a20724b2ac758fa33af089a522.zip
cpython-94f30c75576bb8a20724b2ac758fa33af089a522.tar.gz
cpython-94f30c75576bb8a20724b2ac758fa33af089a522.tar.bz2
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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2023-05-03-19-22-24.gh-issue-90208.tI00da.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2023-05-03-19-22-24.gh-issue-90208.tI00da.rst b/Misc/NEWS.d/next/Library/2023-05-03-19-22-24.gh-issue-90208.tI00da.rst
new file mode 100644
index 0000000..1fd9588
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-05-03-19-22-24.gh-issue-90208.tI00da.rst
@@ -0,0 +1,4 @@
+Fixed issue where :meth:`pathlib.Path.glob` returned incomplete results when
+it encountered a :exc:`PermissionError`. This method now suppresses all
+:exc:`OSError` exceptions, except those raised from calling
+:meth:`~pathlib.Path.is_dir` on the top-level path.