diff options
author | Barney Gale <barney.gale@gmail.com> | 2025-03-24 15:12:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-24 15:12:29 +0000 |
commit | fbfb0e1f6efae7055f7420c999ad6256e10d6b62 (patch) | |
tree | 30ef528f991bad777eea08438378793eeed94117 /Lib/test/test_pathlib/test_read.py | |
parent | a04c0a9658237d536a68e745d1efd157ab87ec9c (diff) | |
download | cpython-fbfb0e1f6efae7055f7420c999ad6256e10d6b62.tar.gz cpython-fbfb0e1f6efae7055f7420c999ad6256e10d6b62.zip |
GH-128520: pathlib ABCs: reject empty pattern in `ReadablePath.glob()` (#127343)
For compatibility with `Path.glob()`, raise `ValueError` if an empty
pattern is given to `ReadablePath.glob()`.
Diffstat (limited to 'Lib/test/test_pathlib/test_read.py')
-rw-r--r-- | Lib/test/test_pathlib/test_read.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_pathlib/test_read.py b/Lib/test/test_pathlib/test_read.py index 938d3a1e987..1a14649fafe 100644 --- a/Lib/test/test_pathlib/test_read.py +++ b/Lib/test/test_pathlib/test_read.py @@ -127,6 +127,8 @@ class ReadTestBase: check("**/file*", ["fileA", "dirA/linkC/fileB", "dirB/fileB", "dirC/fileC", "dirC/dirD/fileD", "linkB/fileB"]) + with self.assertRaisesRegex(ValueError, 'Unacceptable pattern'): + list(p.glob('')) def test_walk_top_down(self): it = self.root.walk() |