Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.match honors Windows path separators on Windows #92

Closed
jaraco opened this issue Feb 15, 2023 · 0 comments · Fixed by #103
Closed

.match honors Windows path separators on Windows #92

jaraco opened this issue Feb 15, 2023 · 0 comments · Fixed by #103

Comments

@jaraco
Copy link
Owner

jaraco commented Feb 15, 2023

Considering the match implementation:

return pathlib.Path(self.at).match(path_pattern)

The use of pathlib.Path here means that on Windows, a backslash will match a path separator:

>>> pathlib.Path('foo/bar.txt').match('foo\\*')
True

Perhaps that is undesirable and only posix paths should match (as those are all that are allowed in zip file separators). Perhaps PurePosixPath should be used:

>>> pathlib.PurePosixPath('foo/bar.txt').match('foo\\*')
False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant