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

(cherry picked from commit 935586845815f5b4c7814794413f6a812d4bd45f)
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 957e7a4..beafe0d 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -534,7 +534,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}")