From e61336c2a344428649e6be98efa4c7d34f799fed Mon Sep 17 00:00:00 2001 From: Ilya Shakhat Date: Wed, 13 Aug 2014 15:47:57 +0400 Subject: [PATCH] Fix reading of emails archives Change-Id: I3a04877f19a06bb641b1b6dc3b82c0414de56c55 --- stackalytics/processor/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stackalytics/processor/utils.py b/stackalytics/processor/utils.py index dc66b2be5..59909db93 100644 --- a/stackalytics/processor/utils.py +++ b/stackalytics/processor/utils.py @@ -89,7 +89,7 @@ def check_email_validity(email): def read_uri(uri): try: fd = six.moves.urllib.request.urlopen(uri) - raw = fd.read().decode('utf8') + raw = fd.read() fd.close() return raw except Exception as e: @@ -107,9 +107,9 @@ def read_json_from_uri(uri): def gzip_decompress(content): if six.PY3: - return gzip.decompress(content) + return gzip.decompress(content).decode('utf8') else: - gzip_fd = gzip.GzipFile(fileobj=six.moves.StringIO.StringIO(content)) + gzip_fd = gzip.GzipFile(fileobj=six.moves.StringIO(content)) return gzip_fd.read()