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

(cherry picked from commit 9355868458)
This commit is contained in:
Serhiy Storchaka 2020-07-02 10:05:16 +03:00 committed by GitHub
parent df59293bf0
commit ecfecc2d6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 40 additions and 30 deletions

View file

@ -152,7 +152,7 @@ def testall(list, recursive, toplevel):
if recursive or toplevel:
print('recursing down:')
import glob
names = glob.glob(os.path.join(filename, '*'))
names = glob.glob(os.path.join(glob.escape(filename), '*'))
testall(names, recursive, 0)
else:
print('*** directory (use -r) ***')