From 01b02ccd8417c21a244807de2260d09a7d3c4f87 Mon Sep 17 00:00:00 2001 From: Maciek Date: Sat, 18 Nov 2017 13:40:50 +1100 Subject: [PATCH 1/3] 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/3] 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', {}) From f47aa13dd361d3d90472987a9f2eb02a12a83de6 Mon Sep 17 00:00:00 2001 From: cyzanfar Date: Wed, 6 Dec 2017 17:58:42 -0500 Subject: [PATCH 3/3] Python version 3 compatible --- tests/exchange/test_server_bundle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/exchange/test_server_bundle.py b/tests/exchange/test_server_bundle.py index 50dd98d7..42b2d3f3 100644 --- a/tests/exchange/test_server_bundle.py +++ b/tests/exchange/test_server_bundle.py @@ -51,7 +51,7 @@ class ValidateChunks(object): if data_frequency == 'daily': end = end - pd.Timedelta(hours=23, minutes=59) - print start, end, data_frequency + print(start, end, data_frequency) arrays = reader.load_raw_arrays(self.columns, start, end, [asset.sid, ])