From e73896241e55f452656fd8070eb79f344091bca0 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 2 Jul 2020 10:05:35 +0300 Subject: [3.8] bpo-41043: Escape literal part of the path for glob(). (GH-20994). (GH-21277) (cherry picked from commit 935586845815f5b4c7814794413f6a812d4bd45f) --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index b168ed4082..6340669fff 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ import os import re import sys import sysconfig -from glob import glob +from glob import glob, escape from distutils import log from distutils.command.build_ext import build_ext @@ -339,7 +339,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")) # The sysconfig variables built by makesetup that list the already # built modules and the disabled modules as configured by the Setup @@ -2256,7 +2256,7 @@ class PyBuildExt(build_ext): self.add(Extension('_sha1', ['sha1module.c'], depends=['hashlib.h'])) - blake2_deps = glob(os.path.join(self.srcdir, + blake2_deps = glob(os.path.join(escape(self.srcdir), 'Modules/_blake2/impl/*')) blake2_deps.append('hashlib.h') @@ -2266,7 +2266,7 @@ class PyBuildExt(build_ext): '_blake2/blake2s_impl.c'], depends=blake2_deps)) - sha3_deps = glob(os.path.join(self.srcdir, + sha3_deps = glob(os.path.join(escape(self.srcdir), 'Modules/_sha3/kcp/*')) sha3_deps.append('hashlib.h') self.add(Extension('_sha3', -- cgit v1.2.1