From e3e3d0b1f543e8a9a2c6122de894ef3c26d718bd Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 20 Oct 2015 00:11:39 -0700 Subject: [PATCH] py3 compat changes --- panoramix/bin/panoramix | 4 +++- panoramix/models.py | 1 - tests/core_tests.py | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/panoramix/bin/panoramix b/panoramix/bin/panoramix index 9a7ac4f0b..22b4507ed 100755 --- a/panoramix/bin/panoramix +++ b/panoramix/bin/panoramix @@ -79,7 +79,9 @@ def load_examples(sample): BirthNames.create(db.engine) session = db.session() - with gzip.open(config.get("BASE_DIR") + '/data/birth_names.csv.gz') as f: + with gzip.open( + config.get("BASE_DIR") + '/data/birth_names.csv.gz', + encoding="ascii") as f: bb_csv = csv.reader(f) for i, (state, year, name, gender, num) in enumerate(bb_csv): if i == 0 or year < "1965": # jumpy data before 1965 diff --git a/panoramix/models.py b/panoramix/models.py index a55e56a3b..dfa345914 100644 --- a/panoramix/models.py +++ b/panoramix/models.py @@ -458,7 +458,6 @@ class SqlaTable(Model, Queryable, AuditMixinNullable): engine = self.database.get_sqla_engine() sql = str(qry.compile(engine, compile_kwargs={"literal_binds": True})) - print sql df = read_sql_query( sql=sql, con=engine diff --git a/tests/core_tests.py b/tests/core_tests.py index 49d10d4ae..a9aac3220 100644 --- a/tests/core_tests.py +++ b/tests/core_tests.py @@ -1,7 +1,6 @@ import imp import os import unittest -import urllib2 os.environ['PANORAMIX_CONFIG'] = 'tests.panoramix_test_config' from flask.ext.testing import LiveServerTestCase, TestCase