summaryrefslogtreecommitdiff
path: root/Lib/imghdr.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-06-20 11:10:31 +0300
committerGitHub <noreply@github.com>2020-06-20 11:10:31 +0300
commit935586845815f5b4c7814794413f6a812d4bd45f (patch)
tree69297d0f173d3b42895adb1da65c99f1e021b586 /Lib/imghdr.py
parenta041e116db5f1e78222cbf2c22aae96457372680 (diff)
downloadcpython-git-935586845815f5b4c7814794413f6a812d4bd45f.tar.gz
bpo-41043: Escape literal part of the path for glob(). (GH-20994)
Diffstat (limited to 'Lib/imghdr.py')
-rw-r--r--Lib/imghdr.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/imghdr.py b/Lib/imghdr.py
index 76e8abb2d5..6e01fd8574 100644
--- a/Lib/imghdr.py
+++ b/Lib/imghdr.py
@@ -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) ***')