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

Achieve parity with globbing functionality in Python >= 3.13 #479

Open
3 tasks
pjbull opened this issue Oct 17, 2024 · 0 comments
Open
3 tasks

Achieve parity with globbing functionality in Python >= 3.13 #479

pjbull opened this issue Oct 17, 2024 · 0 comments

Comments

@pjbull
Copy link
Member

pjbull commented Oct 17, 2024

There are a few limitations to our current implementation for glob in newer versions of Python. In #474, we introduced cloupathlib/legacy/glob.py that has CPython code that was removed in 3.13, but we need for globbing.

This also means that there is no good way to implement parity with the behavior in 3.13 that globbing with a pattern that ends with “**” returns both files and directories. In previous versions, only directories were returned. Our current implementation does not have parity; if you add a test for path.glob("**") because Python 3.13 in this instance returns the directory path represents and we don't.

We should update our glob implementation in the following ways:

  • Use the new glob.translate for our glob implementation if Python version supports it (and maybe even backport).
  • Remove the vendored CPython code in cloupathlib/legacy/glob.py
  • Fix the mismatch with patterns ending in ** discussed above
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

No branches or pull requests

1 participant