summaryrefslogtreecommitdiff
path: root/coverage/data.py
diff options
context:
space:
mode:
authorearthman1 <30826762+earthman1@users.noreply.github.com>2022-08-06 14:57:19 -0400
committerGitHub <noreply@github.com>2022-08-06 11:57:19 -0700
commit36f508f98f74b44a1f7aed23f2beecb4189025ca (patch)
tree152ab30645943630274fc6bedab508ffcc10e139 /coverage/data.py
parent774c364b8eddfb53c3da5c8827f27ea279401316 (diff)
downloadpython-coveragepy-git-36f508f98f74b44a1f7aed23f2beecb4189025ca.tar.gz
fix: filenames can contain special glob characters (#1405)
* Fix globbing of filenames that contain special glob characters * glob the path as well as the filename
Diffstat (limited to 'coverage/data.py')
-rw-r--r--coverage/data.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/coverage/data.py b/coverage/data.py
index b209cf15..4bdfe301 100644
--- a/coverage/data.py
+++ b/coverage/data.py
@@ -70,7 +70,7 @@ def combinable_files(data_file, data_paths=None):
if os.path.isfile(p):
files_to_combine.append(os.path.abspath(p))
elif os.path.isdir(p):
- pattern = os.path.join(os.path.abspath(p), f"{local}.*")
+ pattern = glob.escape(os.path.join(os.path.abspath(p), local)) +".*"
files_to_combine.extend(glob.glob(pattern))
else:
raise NoDataError(f"Couldn't combine from non-existent path '{p}'")