From b94294445d8392ff0027b6b0c78998b0099a857b Mon Sep 17 00:00:00 2001 From: Andy Doan Date: Mon, 24 Aug 2015 11:39:30 -0500 Subject: gerrit started working right - now we don't We've always claimed in our gerrit requests to accept gzip data. However we don't actually have any logic to deal with it. Over the weekend Gerrit finally started honoring our header and now we get error email like: Traceback (most recent call last): File "/srv/patches.linaro.org/apps/patchmetrics/bin/sync-gerrit-changes.py", line 30, in if ("Error in operator owner:%s" % user_email) in str(e): UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 1: ordinal not in range(128) Change-Id: Icf76acd023cb0411af8f2929abf59bd83b20f34a --- apps/patchmetrics/gerrit.py | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/patchmetrics/gerrit.py b/apps/patchmetrics/gerrit.py index 0713dae..0929f0c 100644 --- a/apps/patchmetrics/gerrit.py +++ b/apps/patchmetrics/gerrit.py @@ -142,7 +142,6 @@ def gerrit_request(request_url): # https://groups.google.com/group/repo-discuss/msg/78e70b07ad1aacce # https://gerrit-review.googlesource.com/Documentation/rest-api.html request.add_header("Accept", "application/json") - request.add_header("Accept-Encoding", "gzip") # The request in this case needs to be a GET. json_string = sanitize_json_response(urllib2.urlopen(request).read()) json_object = json.loads(json_string) -- cgit v1.2.3