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

Generalize glob functionality. #108

Merged
merged 7 commits into from
Dec 16, 2023
Merged

Generalize glob functionality. #108

merged 7 commits into from
Dec 16, 2023

Conversation

jaraco
Copy link
Owner

@jaraco jaraco commented Aug 5, 2023

Inspired by work in python/cpython#106703.

Achieves:

  • Adds support for newlines and fullmatch in the generated pattern.
  • Adds support for arbitrary path separators, defaulting to platform separators.
  • Fails when ** appears as anything but a full path segment.
  • Requires at least one char for * in a full path segment.

@jaraco
Copy link
Owner Author

jaraco commented Aug 5, 2023

There's an issue with the Windows implementation, I worry it may not honor path separators the way glob does:

 draft @ mkdir cont
 draft @ touch cont/item.txt
 draft @ glob.glob('cont/*')
['cont\\item.txt']

(The regex produced will still only have / as the separator so wouldn't match cont\\item.txt)

@jaraco jaraco marked this pull request as ready for review December 16, 2023 19:06
@jaraco jaraco merged commit e8044c1 into main Dec 16, 2023
26 of 28 checks passed
@jaraco jaraco deleted the feature/glob-alignment branch December 16, 2023 19:06
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 this pull request may close these issues.

1 participant