diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-07-02 07:05:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 07:05:35 (GMT) |
commit | e73896241e55f452656fd8070eb79f344091bca0 (patch) | |
tree | 5ce7fe2022e0ce1d481347ee49dab9d5580fb501 /Tools | |
parent | cbdacb94c1a096387e1fb37d4e44bb3847d0c4f8 (diff) | |
download | cpython-e73896241e55f452656fd8070eb79f344091bca0.zip cpython-e73896241e55f452656fd8070eb79f344091bca0.tar.gz cpython-e73896241e55f452656fd8070eb79f344091bca0.tar.bz2 |
[3.8] bpo-41043: Escape literal part of the path for glob(). (GH-20994). (GH-21277)
(cherry picked from commit 935586845815f5b4c7814794413f6a812d4bd45f)
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/c-globals/check-c-globals.py | 4 | ||||
-rwxr-xr-x | Tools/ssl/make_ssl_data.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Tools/c-globals/check-c-globals.py b/Tools/c-globals/check-c-globals.py index e68ed92..1371f92 100644 --- a/Tools/c-globals/check-c-globals.py +++ b/Tools/c-globals/check-c-globals.py @@ -37,7 +37,9 @@ IGNORED_VARS = { def find_capi_vars(root): capi_vars = {} for dirname in SOURCE_DIRS: - for filename in glob.glob(os.path.join(ROOT_DIR, dirname, '**/*.[hc]'), + for filename in glob.glob(os.path.join( + glob.escape(os.path.join(ROOT_DIR, dirname)), + '**/*.[hc]'), recursive=True): with open(filename) as file: for name in _find_capi_vars(file): diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py index d60f352..c39e38c 100755 --- a/Tools/ssl/make_ssl_data.py +++ b/Tools/ssl/make_ssl_data.py @@ -39,7 +39,7 @@ if __name__ == "__main__": f = sys.stdout if use_stdout else open(outfile, "w") # mnemonic -> (library code, error prefix, header file) error_libraries = {} - for error_header in glob.glob(os.path.join(openssl_inc, 'include/openssl/*err.h')): + for error_header in glob.glob(os.path.join(glob.escape(openssl_inc), 'include/openssl/*err.h')): base = os.path.basename(error_header) if base in ('buffererr.h', 'objectserr.h', 'storeerr.h'): # Deprecated in 3.0. |