From 06685ec48daf036fc90f8df06dc3d0bd79466c8d Mon Sep 17 00:00:00 2001 From: Alexander Hirner <6055037+ahirner@users.noreply.github.com> Date: Wed, 13 May 2020 15:29:20 +0200 Subject: [PATCH] boto3 1.13.1 returns descriptive range error code (#3609) --- tensorboard/compat/tensorflow_stub/io/gfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorboard/compat/tensorflow_stub/io/gfile.py b/tensorboard/compat/tensorflow_stub/io/gfile.py index 3e38a8510c..f5394be736 100644 --- a/tensorboard/compat/tensorflow_stub/io/gfile.py +++ b/tensorboard/compat/tensorflow_stub/io/gfile.py @@ -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.