From 36f508f98f74b44a1f7aed23f2beecb4189025ca Mon Sep 17 00:00:00 2001 From: earthman1 <30826762+earthman1@users.noreply.github.com> Date: Sat, 6 Aug 2022 14:57:19 -0400 Subject: 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 --- coverage/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coverage/data.py') 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}'") -- cgit v1.2.1