diff -r 5de1bd759f3b Lib/pathlib.py --- a/Lib/pathlib.py Sat Jan 23 14:15:48 2016 +0100 +++ b/Lib/pathlib.py Sat Jan 23 17:14:53 2016 -0500 @@ -1065,6 +1065,8 @@ """Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given pattern. """ + if not pattern: + raise ValueError("unacceptable pattern: {}".format(repr(pattern))) pattern = self._flavour.casefold(pattern) drv, root, pattern_parts = self._flavour.parse_parts((pattern,)) if drv or root: diff -r 5de1bd759f3b Lib/test/test_pathlib.py --- a/Lib/test/test_pathlib.py Sat Jan 23 14:15:48 2016 +0100 +++ b/Lib/test/test_pathlib.py Sat Jan 23 17:14:53 2016 -0500 @@ -1969,6 +1969,11 @@ else: self.assertRaises(NotImplementedError, pathlib.WindowsPath) + def test_glob(self): + p = self.cls() + gen = p.glob("") + self.assertRaises(ValueError, list, gen) + @only_posix class PosixPathTest(_BasePathTest, unittest.TestCase):