From 4b3394176a6139ed33a7d0a06f151daf8fb4e0bf Mon Sep 17 00:00:00 2001 From: Alexei Barantsev Date: Thu, 30 Nov 2017 09:50:52 +0300 Subject: [PATCH] Files should be read and uploaded in binary mode --- third_party/py/googlestorage/publish_release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/py/googlestorage/publish_release.py b/third_party/py/googlestorage/publish_release.py index d7532029edc08..9628499c3d8e4 100644 --- a/third_party/py/googlestorage/publish_release.py +++ b/third_party/py/googlestorage/publish_release.py @@ -109,7 +109,7 @@ def _upload(auth_http, project_id, bucket_name, file_path, object_name, acl): object_name: The name within the bucket to upload to. acl: The ACL to assign to the uploaded file. """ - with open(file_path, 'r') as f: + with open(file_path, 'rb') as f: data = f.read() content_type, content_encoding = mimetypes.guess_type(file_path)