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

This commit is contained in:
Serhiy Storchaka 2020-06-20 11:10:31 +03:00 committed by GitHub
parent a041e116db
commit 9355868458
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 37 additions and 31 deletions

View file

@ -8,7 +8,7 @@ import os
import re
import sys
import sysconfig
from glob import glob
from glob import glob, escape
try:
@ -401,7 +401,7 @@ class PyBuildExt(build_ext):
# Python header files
headers = [sysconfig.get_config_h_filename()]
headers += glob(os.path.join(sysconfig.get_path('include'), "*.h"))
headers += glob(os.path.join(escape(sysconfig.get_path('include')), "*.h"))
for ext in self.extensions:
ext.sources = [ find_module_file(filename, moddirlist)
@ -2431,7 +2431,7 @@ class PyBuildExt(build_ext):
if "blake2" in configured:
blake2_deps = glob(
os.path.join(self.srcdir, 'Modules/_blake2/impl/*')
os.path.join(escape(self.srcdir), 'Modules/_blake2/impl/*')
)
blake2_deps.append('hashlib.h')
self.add(Extension(
@ -2446,7 +2446,7 @@ class PyBuildExt(build_ext):
if "sha3" in configured:
sha3_deps = glob(
os.path.join(self.srcdir, 'Modules/_sha3/kcp/*')
os.path.join(escape(self.srcdir), 'Modules/_sha3/kcp/*')
)
sha3_deps.append('hashlib.h')
self.add(Extension(