fsspec / universal_pathlib

pathlib api extended to use fsspec backends
MIT License
240 stars 41 forks source link

`S3Path.touch` with `exist_ok=True` on existing file raises an error #216

Closed Koncopd closed 1 month ago

Koncopd commented 5 months ago

S3Path.touch with exist_ok=True on existing file raises an error. Here exist_ok=True sets truncate to False and this raises the error here

On 0.1.4 it worked fine.

ap-- commented 5 months ago

Thank you for opening the issue, @Koncopd .

Would you be interested in adding a test case for the touch behavior to the base tests?

Cheers, Andreas

Koncopd commented 5 months ago

Yes, i can work on this.

Koncopd commented 3 months ago

I actually think that the current behavior is correct, and truncate=True should not be passed by default. On the other hand it is strange that .touch(exist_ok=False) works fine on an existing file.