Skip to content

Commit

Permalink
boto3 1.13.1 returns descriptive range error code (tensorflow#3609)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahirner authored and caisq committed May 19, 2020
1 parent 7cfaa4d commit 6a1a7fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorboard/compat/tensorflow_stub/io/gfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def read(self, filename, binary_mode=False, size=None, continue_from=None):
try:
stream = s3.Object(bucket, path).get(**args)["Body"].read()
except botocore.exceptions.ClientError as exc:
if exc.response["Error"]["Code"] == "416":
if exc.response["Error"]["Code"] in ["416", "InvalidRange"]:
if size is not None:
# Asked for too much, so request just to the end. Do this
# in a second request so we don't check length in all cases.
Expand Down

0 comments on commit 6a1a7fb

Please sign in to comment.