aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/gmg_commands/batchaddmedia.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-06-25 22:24:03 +0300
committerBerker Peksag <berker.peksag@gmail.com>2015-06-25 22:24:50 +0300
commitcc92922386937d9f416e9166ac1e672a0f775b53 (patch)
tree497461a64de6a3a47e1bae24da6d27614c490fc7 /mediagoblin/gmg_commands/batchaddmedia.py
parent2c1b0dc3e34ff3095ea249df840a21e11fadaaf7 (diff)
downloadmediagoblin-cc92922386937d9f416e9166ac1e672a0f775b53.tar.lz
mediagoblin-cc92922386937d9f416e9166ac1e672a0f775b53.tar.xz
mediagoblin-cc92922386937d9f416e9166ac1e672a0f775b53.zip
Change all unicode() calls with six.text_type().
Fixes #5329.
Diffstat (limited to 'mediagoblin/gmg_commands/batchaddmedia.py')
-rw-r--r--mediagoblin/gmg_commands/batchaddmedia.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mediagoblin/gmg_commands/batchaddmedia.py b/mediagoblin/gmg_commands/batchaddmedia.py
index 4137b55c..5a47d698 100644
--- a/mediagoblin/gmg_commands/batchaddmedia.py
+++ b/mediagoblin/gmg_commands/batchaddmedia.py
@@ -178,11 +178,12 @@ u"FAIL: This file is larger than the upload limits for this site."))
def unicode_csv_reader(unicode_csv_data, dialect=csv.excel, **kwargs):
# csv.py doesn't do Unicode; encode temporarily as UTF-8:
+ # TODO: this probably won't be necessary in Python 3
csv_reader = csv.reader(utf_8_encoder(unicode_csv_data),
dialect=dialect, **kwargs)
for row in csv_reader:
# decode UTF-8 back to Unicode, cell by cell:
- yield [unicode(cell, 'utf-8') for cell in row]
+ yield [six.text_type(cell, 'utf-8') for cell in row]
def utf_8_encoder(unicode_csv_data):
for line in unicode_csv_data: