bpo-41043: Escape literal part of the path for glob(). (GH-20994)

This commit is contained in:
Serhiy Storchaka 2020-06-20 11:10:31 +03:00 committed by GitHub
parent a041e116db
commit 9355868458
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 37 additions and 31 deletions

View file

@ -543,7 +543,7 @@ class StartupImportTests(unittest.TestCase):
# found in sys.path (see site.addpackage()). Skip the test if at least
# one .pth file is found.
for path in isolated_paths:
pth_files = glob.glob(os.path.join(path, "*.pth"))
pth_files = glob.glob(os.path.join(glob.escape(path), "*.pth"))
if pth_files:
self.skipTest(f"found {len(pth_files)} .pth files in: {path}")