-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Reading a 0 B file from s3 raises KeyError #667
Comments
I am seeing the same issue with reading attempting to open a 0B file. This PR was supposedly merged to fix this issue, but it actually introduces the missing KeyError reported above. The expected key 'ActualObjectSize' cannot be found on botocore.exceptions.ClientError which is the wrapped error that gets returned from the boto3.client.get_object call. I propose that instead of trying to get 'ActualObjectSize' from the wrapped error object, we instead get the content length by making a get_object call without the range_string if there is an InvalidRange error:
|
Do we need to make an additional call? If yes, then I'd rather avoid doing unless it's absolutely necessary. Are you interested in making a PR? |
I am still facing "ClientError: An error occurred (416) when calling the GetObject operation: Requested Range Not Satisfiable" error with latest version |
I created a PR calling This way it should limit unnecessary HTTP call. |
Problem description
A problem is somewhat similar to the one described here #548 , though the Error is not the same.
Be sure your description clearly answers the following questions:
I'm trying to read the file that might be empty in S3.
The file is read without exceptions.
KeyError exception is thrown
Steps/code to reproduce the problem
Traceback:
Versions
Please provide the output of:
Checklist
Before you create the issue, please make sure you have:
The text was updated successfully, but these errors were encountered: