mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Issue #23076: Path.glob() now raises a ValueError if it's called with an
invalid pattern. Patch by Thomas Nyberg.
This commit is contained in:
parent
ef410770a7
commit
4a208e448e
4 changed files with 11 additions and 0 deletions
|
@ -1969,6 +1969,11 @@ class PathTest(_BasePathTest, unittest.TestCase):
|
|||
else:
|
||||
self.assertRaises(NotImplementedError, pathlib.WindowsPath)
|
||||
|
||||
def test_glob_empty_pattern(self):
|
||||
p = self.cls()
|
||||
with self.assertRaisesRegex(ValueError, 'Unacceptable pattern'):
|
||||
list(p.glob(''))
|
||||
|
||||
|
||||
@only_posix
|
||||
class PosixPathTest(_BasePathTest, unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue