From 01b02ccd8417c21a244807de2260d09a7d3c4f87 Mon Sep 17 00:00:00 2001 From: Maciek Date: Sat, 18 Nov 2017 13:40:50 +1100 Subject: [PATCH 1/2] Python 3 support #catalyst/curate/poloniex.py: Change `print url` to `print(url)` --- catalyst/curate/poloniex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst/curate/poloniex.py b/catalyst/curate/poloniex.py index 572cd777..2e51e4fb 100644 --- a/catalyst/curate/poloniex.py +++ b/catalyst/curate/poloniex.py @@ -129,7 +129,7 @@ class PoloniexCurator(object): start = str(newstart), end = str(end) ) - print url + print(url) attempts = 0 success = 0 From 2fdb4dd0bd0645dfd611b8490759a443b146edbf Mon Sep 17 00:00:00 2001 From: Maciek Date: Mon, 27 Nov 2017 20:59:47 +1100 Subject: [PATCH 2/2] Decode poloniex_api.query with utf-8 --- catalyst/exchange/poloniex/poloniex_api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/catalyst/exchange/poloniex/poloniex_api.py b/catalyst/exchange/poloniex/poloniex_api.py index 894ba08b..ce0831bc 100644 --- a/catalyst/exchange/poloniex/poloniex_api.py +++ b/catalyst/exchange/poloniex/poloniex_api.py @@ -107,8 +107,9 @@ class Poloniex_api(object): data=post_data, headers=headers, ) - return json.loads( - urlopen(req, context=ssl._create_unverified_context()).read()) + resource = urlopen(req, context=ssl._create_unverified_context()) + content = resource.read().decode('utf-8') + return json.loads(content) def returnticker(self): return self.query('returnTicker', {})