You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When s3.Object.get() is called with an invalid range header, the Error response dict is missing the ActualObjectSize value, which is necessary to handle the error in client code.
For an example of why this response value is useful, see this smart_open PR, where ActualObjectSize is needed to avoid redundant API queries during seek().
This issue is related to #2964, but I am filing separately since that one could easily be fixed without fixing this one.
Expected behavior using live S3
In [1]: importboto3, botocoreIn [3]: frompprintimportpprintIn [4]: try:
...: boto3.resource('s3').Object('mybucket', 'test.txt').get(Range="bytes=10000-")
...: exceptbotocore.client.ClientErrorase:
...: pprint(e.response)
...:
{'Error': {'ActualObjectSize': '4',
'Code': 'InvalidRange',
'Message': 'The requested range is not satisfiable',
'RangeRequested': 'bytes=10000-'},
'ResponseMetadata': {'HTTPHeaders': {'content-type': 'application/xml',
'date': 'Sun, 10 May 2020 18:14:10 GMT',
'server': 'AmazonS3',
'transfer-encoding': 'chunked',
'x-amz-id-2': '...',
'x-amz-request-id': '...'},
'HTTPStatusCode': 416,
'HostId': '...',
'RequestId': '...',
'RetryAttempts': 1}}
When s3.Object.get() is called with an invalid range header, the Error response dict is missing the ActualObjectSize value, which is necessary to handle the error in client code.
For an example of why this response value is useful, see this smart_open PR, where ActualObjectSize is needed to avoid redundant API queries during
seek()
.This issue is related to #2964, but I am filing separately since that one could easily be fixed without fixing this one.
Expected behavior using live S3
moto behavior
Versions
moto==1.3.14, master
boto==2.49.0
boto3==1.13.0
botocore==1.16.0
The text was updated successfully, but these errors were encountered: