diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2024-02-11 10:24:13 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-11 10:24:13 (GMT) |
| commit | aeffc7f8951e04258f0fd8cadfa6cd8b704730f6 (patch) | |
| tree | d94631781d5bfe099bb9c143ebb8710c20e4db98 /Lib/test | |
| parent | 573acb30f22a84c0f2c951efa002c9946e29b6a3 (diff) | |
| download | cpython-aeffc7f8951e04258f0fd8cadfa6cd8b704730f6.zip cpython-aeffc7f8951e04258f0fd8cadfa6cd8b704730f6.tar.gz cpython-aeffc7f8951e04258f0fd8cadfa6cd8b704730f6.tar.bz2 | |
gh-79382: Fix recursive glob() with trailing "**" (GH-115134)
Trailing "**" no longer allows to match files and non-existing paths in
recursive glob().
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_glob.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py index aa5fac8..8b2ea8f 100644 --- a/Lib/test/test_glob.py +++ b/Lib/test/test_glob.py @@ -333,6 +333,17 @@ class GlobTests(unittest.TestCase): eq(glob.glob('**', recursive=True, include_hidden=True), [join(*i) for i in full+rec]) + def test_glob_non_directory(self): + eq = self.assertSequencesEqual_noorder + eq(self.rglob('EF'), self.joins(('EF',))) + eq(self.rglob('EF', ''), []) + eq(self.rglob('EF', '*'), []) + eq(self.rglob('EF', '**'), []) + eq(self.rglob('nonexistent'), []) + eq(self.rglob('nonexistent', ''), []) + eq(self.rglob('nonexistent', '*'), []) + eq(self.rglob('nonexistent', '**'), []) + def test_glob_many_open_files(self): depth = 30 base = os.path.join(self.tempdir, 'deep') |
