-
Notifications
You must be signed in to change notification settings - Fork 365
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
"File name too long" with HTTP presigned requests #1504
Comments
In the original discussion I suggested fixing the bug by breaking up the
i think it would also be helpful to return the constructed |
We assume that the local filename should match the remote one when copying to inside a directory - this is what any copy operation would guarantee. The question is, what part of the remote URL we consider the "filename". Specifically for HTTP, it's not obvious whether query parameters are or are not part; but maybe the correct information is available in the headers. |
I don't think you can guarantee that behavior; the source system might have fundamentally different path limits or requirements than the dest system. if we assume that the query param is removed entirely and a legal 1000 character filename is part of the url, what can/should fsspec do to copy the file locally? |
I think that in cases where the local filesystem can't handle a name, the caller should supply explicit names to write to using list inputs, or use get_file() instead of get(). |
it seems awkward to force callers to create a list if they are interacting with a single file. especially if that requirement is only valid when
I created a couple unit tests today and it works great when I found that passing in a dir for here is the test that shows the behavior:
|
I don't think there is a general solution to this
Yes!
Indeed, this copies from a file path to a file path, which is why it gets around the case of auto-generated names |
Discussed in #1490
Originally posted by cgrass January 4, 2024
Hello,
I'm new to python and fsspec, so hopefully there is an obvious answer to my question. Thanks for the help!
Issue
I need to fetch a file from an s3 bucket using https and a pre-signed URL. The URL produced is quite long, commonly over 1500 characters (mostly query params). If I use the code below, I get an OS exception:
File name too long
.I walked through the code and can see that the
rpath
is typically appended to thelpath
for storage inasyn.py
:Question
Am I misusing the lib or protocol? Is there a way to configure fsspec to scrub query params (or use some arbitrary string) for the appended destination string?
Setup
MacOS Ventura M1 Pro
fsspec-2023.12.2
Python 3.9, 3.10 (tried both)
Linked bug report
The text was updated successfully, but these errors were encountered: