diff --git a/autouri/gcsuri.py b/autouri/gcsuri.py index e5c3221..7b5d51e 100644 --- a/autouri/gcsuri.py +++ b/autouri/gcsuri.py @@ -103,6 +103,9 @@ def _acquire(self): raise except (NotFound, ClientError, ValueError): pass + except TypeError: + # this happens if file exists and failed to get metadata, so u.mtime is None + pass return None def _release(self): @@ -208,7 +211,7 @@ def get_metadata(self, skip_md5=False, make_md5_file=False): def read(self, byte=False): blob, _ = self.get_blob() - b = blob.download_as_string() + b = blob.download_as_bytes() if byte: return b return b.decode()