bpo-41043: Escape literal part of the path for glob(). (GH-20994)
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index de209da..6745be6 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -556,7 +556,7 @@
args = ['-Wd', '-E', '-bb', '-m', 'test.regrtest', '--list-tests']
output = self.run_python(args)
rough_number_of_tests_found = len(output.splitlines())
- actual_testsuite_glob = os.path.join(os.path.dirname(__file__),
+ actual_testsuite_glob = os.path.join(glob.escape(os.path.dirname(__file__)),
'test*.py')
rough_counted_test_py_files = len(glob.glob(actual_testsuite_glob))
# We're not trying to duplicate test finding logic in here,