bpo-41043: Escape literal part of the path for glob(). (GH-20994)
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 9f4a8bc..9751c64 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -543,7 +543,7 @@
# 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}")