Skip to content

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 jaraco marked this pull request as draft August 5, 2023 17:16
@jaraco jaraco force-pushed the feature/glob-alignment branch from 56a8ce5 to 500b3f6 Compare August 5, 2023 17:51
@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 force-pushed the feature/glob-alignment branch from 500b3f6 to d96d81a Compare December 16, 2023 18:53
@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
@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.

2 participants