mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-41043: Escape literal part of the path for glob(). (GH-20994)
This commit is contained in:
parent
a041e116db
commit
9355868458
24 changed files with 37 additions and 31 deletions
|
@ -70,7 +70,7 @@ class BaseTest(unittest.TestCase):
|
|||
# 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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue