Skip to content

Commit

Permalink
Merge pull request #34 from ENCODE-DCC/dev
Browse files Browse the repository at this point in the history
fix gcs lock issue, replace deprecated gs function
  • Loading branch information
leepc12 authored Nov 7, 2022
2 parents 5f96f8a + 9744635 commit ceb681a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autouri/gcsuri.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit ceb681a

Please sign in to comment.