diff --git a/newsfragments/+0fed595d.bugfix.rst b/newsfragments/+0fed595d.bugfix.rst new file mode 100644 index 0000000..a12f6e5 --- /dev/null +++ b/newsfragments/+0fed595d.bugfix.rst @@ -0,0 +1 @@ +Avoid matching path separators for '?' in glob. \ No newline at end of file diff --git a/zipp/glob.py b/zipp/glob.py index 4a2e665..63ff8b9 100644 --- a/zipp/glob.py +++ b/zipp/glob.py @@ -8,7 +8,7 @@ def translate(pattern): >>> translate('*.txt') '[^/]*\\.txt' >>> translate('a?txt') - 'a.txt' + 'a[^/]txt' >>> translate('**/*') '.*/[^/]*' """ @@ -36,5 +36,5 @@ def replace(match): re.escape(match.group(0)) .replace('\\*\\*', r'.*') .replace('\\*', r'[^/]*') - .replace('\\?', r'.') + .replace('\\?', r'[^/]') )