bpo-41043: Escape literal part of the path for glob(). (GH-20994)
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index 91ccff2..8f0773d 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -70,7 +70,7 @@
# simply use the bigger test data for all tests.
test_size = 0
BIG_TEXT = bytearray(128*1024)
- for fname in glob.glob(os.path.join(os.path.dirname(__file__), '*.py')):
+ for fname in glob.glob(os.path.join(glob.escape(os.path.dirname(__file__)), '*.py')):
with open(fname, 'rb') as fh:
test_size += fh.readinto(memoryview(BIG_TEXT)[test_size:])
if test_size > 128*1024: