This is an automated email from the ASF dual-hosted git repository.

tillt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 261d6ef  Fixed JSON object type error when using 
`support/apply-reviews.py`.
261d6ef is described below

commit 261d6ef497383795557aaca5dce426b4482eabea
Author: Armand Grillet <agril...@mesosphere.io>
AuthorDate: Wed Oct 10 15:55:08 2018 +0200

    Fixed JSON object type error when using `support/apply-reviews.py`.
    
    The error `TypeError: the JSON object must be str, not 'bytes'` was
    visible when using `support/apply-reviews.py` in our CI. This issue
    seems to only happen in old versions of Python 3 that are not supported
    but the fix works with any version of Python 3 and allows us to not
    change the Python interpreter used by reviewbot.
    
    Review: https://reviews.apache.org/r/68970/
---
 support/apply-reviews.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/support/apply-reviews.py b/support/apply-reviews.py
index 92ad859..a21ee8c 100755
--- a/support/apply-reviews.py
+++ b/support/apply-reviews.py
@@ -94,9 +94,8 @@ def patch_url(options):
 
 def url_to_json(url):
     """Performs HTTP request and returns JSON-ified response."""
-    json_str = urllib.request.urlopen(url)
-    return json.loads(json_str.read())
-
+    json_str = urllib.request.urlopen(url).read().decode('utf-8')
+    return json.loads(json_str)
 
 def extract_review_id(url):
     """Extracts review ID from Review Board URL."""

Reply via email to