From e104943e127c93cb36a4487d306cda09dce23c3c Mon Sep 17 00:00:00 2001 From: "K.Kanakhin" Date: Mon, 10 Oct 2016 20:13:51 +0600 Subject: [PATCH] storage: Fix build-release-tarball py3 compatibility. - Open files in storage.py with 'rb' mode which allow to use decode command in PY3. --- zerver/storage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/storage.py b/zerver/storage.py index a52dcc9d05..457aea9e36 100644 --- a/zerver/storage.py +++ b/zerver/storage.py @@ -14,7 +14,7 @@ class AddHeaderMixin(object): if dry_run: return [] - with open(settings.STATIC_HEADER_FILE) as header_file: + with open(settings.STATIC_HEADER_FILE, 'rb') as header_file: header = header_file.read().decode(settings.FILE_CHARSET) # A dictionary of path to tuples of (old_path, new_path, @@ -30,7 +30,7 @@ class AddHeaderMixin(object): continue # Prepend the header - with storage.open(path) as orig_file: + with storage.open(path, 'rb') as orig_file: orig_contents = orig_file.read().decode(settings.FILE_CHARSET) storage.delete(path)