Skip to content

Commit

Permalink
Avoid matching path separators for '?' in glob.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 5, 2023
1 parent 0dc7e5e commit 1067f1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions newsfragments/+0fed595d.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid matching path separators for '?' in glob.
4 changes: 2 additions & 2 deletions zipp/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def translate(pattern):
>>> translate('*.txt')
'[^/]*\\.txt'
>>> translate('a?txt')
'a.txt'
'a[^/]txt'
>>> translate('**/*')
'.*/[^/]*'
"""
Expand Down Expand Up @@ -36,5 +36,5 @@ def replace(match):
re.escape(match.group(0))
.replace('\\*\\*', r'.*')
.replace('\\*', r'[^/]*')
.replace('\\?', r'.')
.replace('\\?', r'[^/]')
)

0 comments on commit 1067f1f

Please sign in to comment.