Skip to content

Generalize glob functionality. - #108

Merged
jaraco merged 7 commits into
mainfrom
feature/glob-alignment
Dec 16, 2023
Merged

Generalize glob functionality.#108
jaraco merged 7 commits into
mainfrom
feature/glob-alignment

Conversation

@jaraco

@jaraco jaraco commented Aug 5, 2023

Copy link
Copy Markdown
Owner

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

jaraco commented Aug 5, 2023

Copy link
Copy Markdown
Owner Author

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.

1 participant