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

Problem with opening local file with "compression=..." #171

Closed
seandavi opened this issue Jan 24, 2024 · 1 comment · Fixed by #204
Closed

Problem with opening local file with "compression=..." #171

seandavi opened this issue Jan 24, 2024 · 1 comment · Fixed by #204
Labels
compatibility 🤝 Compatibility with stdlib pathlib

Comments

@seandavi
Copy link

See behavior difference with "file://filename" uri vs "filename" uri with compression.

>>> print(upath.__version__)
0.1.4
>>> a = UPath('abc.json.gz')
>>> a.open('wb', compression='gzip')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: open() got an unexpected keyword argument 'compression'
>>> 
>>> a = UPath('file:///tmp/abc.json.gz')
>>> a.open('wb', compression='gzip')
<gzip fsspec.implementations.local.LocalFileOpener object at 0x1028548b0 0x1034b1f40>
@ap-- ap-- added the compatibility 🤝 Compatibility with stdlib pathlib label Jan 24, 2024
@ap--
Copy link
Collaborator

ap-- commented Jan 24, 2024

Thank you for reporting @seandavi ❤️

We should align the method signatures and raise a warning for stdlib pathlib in this case.

Would you be willing to work on a PR?

Cheers,
Andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility 🤝 Compatibility with stdlib pathlib
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants