mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[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:
parent
df59293bf0
commit
ecfecc2d6c
24 changed files with 40 additions and 30 deletions
|
@ -413,7 +413,7 @@ class Grail(BaseBrowser):
|
|||
tempdir = os.path.join(tempfile.gettempdir(),
|
||||
".grail-unix")
|
||||
user = pwd.getpwuid(os.getuid())[0]
|
||||
filename = os.path.join(tempdir, user + "-*")
|
||||
filename = os.path.join(glob.escape(tempdir), glob.escape(user) + "-*")
|
||||
maybes = glob.glob(filename)
|
||||
if not maybes:
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue