Skip to content

Commit 7577dbf

Browse files
authored
Merge pull request #10 from ian-r-rose/decode_for_3.5_compat
Decode response body to utf-8 for python 3.5 compatibility.
2 parents 22d487a + 3c71f86 commit 7577dbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jupyterlab_github/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def get(self, path = ''):
5454
client = AsyncHTTPClient()
5555
request = HTTPRequest(api_path, user_agent='JupyterLab GitHub')
5656
response = yield client.fetch(request)
57-
data = json.loads(response.body)
57+
data = json.loads(response.body.decode('utf-8'))
5858

5959
# Check if we need to paginate results.
6060
# If so, get pages until all the results
@@ -64,7 +64,7 @@ def get(self, path = ''):
6464
request = HTTPRequest(next_page_path, user_agent='JupyterLab GitHub')
6565
response = yield client.fetch(request)
6666
next_page_path = self._maybe_get_next_page_path(response)
67-
data.extend(json.loads(response.body))
67+
data.extend(json.loads(response.body.decode('utf-8')))
6868

6969
# Send the results back.
7070
self.finish(json.dumps(data))

0 commit comments

Comments
 (0)