-
Notifications
You must be signed in to change notification settings - Fork 208
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
upload_file() fails when file_or_path is open file larger than 5GB and obj_name is specified #231
Comments
I'll submit a pull request to fix this soon... |
Fixes pycontribs#231: upload_file() fails when file_or_path is open file larger than 5GB.
Fixes pycontribs#231: upload_file() fails when file_or_path is open file larger than 5GB.
I'm not following the disconnect here. What was the full path? If it ended in 'large.mov', that should be the name of the object via the manifest. |
I'd rather not say what the exact full path is because it's client data, but it was contained a directory path as well as a filename (N.B. large.mov isn't actually the real filename either, I changed it too for confidentiality - I don't think that makes any difference but sorry if it caused confusion). The problem is, if you do:
...then pyrax creates an object in If you were to say "when you pass a file object in then the object name is the full path, if you want to specify the object name then you need to explicitly pass an
To be honest I'm not quite sure what's going on here - I'm not sure why the Not quite sure how |
Actually I think that our code that calls pyrax might be doing something weird here - it's probably best if you hold off on this until I've investigated the non-pyrax code! |
OK, I see the problem now. And I don't care about the actual names; I just needed to see the difference between what the file path was and what was being stored. |
Nope - our code looks sane. I thought it might be missing out the However, our code does pass obj_name, so I think that my pyrax change in this pull request doesn't fix the right problem. The problem is that for multi-part uploads pyrax uses |
…e larger than 5GB and obj_name is specified
OK - so the key piece of information that was missing from my original report was that our code is passing obj_name to pyrax. My original "fix" - use basename when deriving object name from file objects - would not fix this issue at all but I still think it's an improvement in behaviour so I'll submit a pull request for it. I now have another change that I think does fix this actual issue. It currently has the 'use basename' commit as its parent commit, but I can unpick it if you want the fix for this usse without the 'use basename' change. |
…e larger than 5GB and obj_name is specified
…e larger than 5GB and obj_name is specified The file name (`fname`) was being used as the object name passed to put_object, instead of the object name, `obj_name`. This caused 2 problems: 1) the object name of the uploaded file was not the one the caller asked for 2) the get_object() call at the end of the method failed because it was (correctly) using `obj_name` as the name of the object to get.
…ch_object_take_2 Fix #231: upload_file() fails when file_or_path is open file larger than 5GB and obj_name is specified
If file_or_path is an open file then its filename is used to name the created object, but the passed obj_name is used in the call to self.get_object() at the end of the method. This results in the following error:
The text was updated successfully, but these errors were encountered: