From 036707868c494081804427c6386f0f296c421d7e Mon Sep 17 00:00:00 2001 From: William Silversmith Date: Wed, 2 Sep 2020 14:02:24 -0400 Subject: [PATCH] fix(GCS): disable md5 and crc checking temporarily Waiting on https://github.com/googleapis/python-storage/pull/258 Until that patch is released, GCS will error on perfectly good files randomly if + or / characters are included in the base64 representation of the hash. --- cloudfiles/interfaces.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cloudfiles/interfaces.py b/cloudfiles/interfaces.py index 429994d..99fa3fe 100644 --- a/cloudfiles/interfaces.py +++ b/cloudfiles/interfaces.py @@ -392,14 +392,14 @@ def get_file(self, file_path, start=None, end=None): except google.cloud.exceptions.NotFound as err: return (None, None, None, None) - hash_type = "md5" - hash_value = blob.md5_hash if blob.component_count is None else None + # hash_type = "md5" + # hash_value = blob.md5_hash if blob.component_count is None else None - if hash_value is None and blob.crc32c is not None: - hash_type = "crc32c" - hash_value = blob.crc32c + # if hash_value is None and blob.crc32c is not None: + # hash_type = "crc32c" + # hash_value = blob.crc32c - return (content, blob.content_encoding, hash_value, hash_type) + return (content, blob.content_encoding, None, None) @retry def size(self, file_path):