From e0f4d3be7ac3efdffb655b73c70d5c373af00361 Mon Sep 17 00:00:00 2001 From: "Eevee (Lexy Munroe)" Date: Wed, 4 Nov 2015 20:03:08 -0800 Subject: [PATCH] Fix `pokedex dump` under Python 2 --- pokedex/db/load.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pokedex/db/load.py b/pokedex/db/load.py index c87304a..805c4ac 100644 --- a/pokedex/db/load.py +++ b/pokedex/db/load.py @@ -402,9 +402,9 @@ def dump(session, tables=[], directory=None, verbose=False, langs=None): else: filename = '%s/%s.csv' % (directory, table_name) - writer = csv.writer(io.open(filename, 'w', newline=''), lineterminator='\n') + writer = csv.writer(io.open(filename, 'wb'), lineterminator='\n') - columns = [col.name for col in table.columns] + columns = [col.name.encode('utf8') for col in table.columns] # For name tables, always dump rows for official languages, as well as # for those in `langs` if specified.