diff roundup/cgi/actions.py @ 4521:abd2db0a159a

Fix StringIO issue2550713: - io.StringIO in newer versions of python returns unicode strings and expects a unicode string in the constructor. Unfortunately csv doesn't handle unicode (yet). So we need to use a BytesIO which gets the utf-8 string from the web-interface. Compatibility for old versions by using Stringio.Stringio for emulating a io.BytesIO also works. - We didn't have a regression test for the EditCSVAction
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Fri, 15 Jul 2011 12:36:47 +0000
parents 693c75d56ebe
children 4f9c3858b671
line wrap: on
line diff
--- a/roundup/cgi/actions.py	Fri Jul 15 10:03:37 2011 +0000
+++ b/roundup/cgi/actions.py	Fri Jul 15 12:36:47 2011 +0000
@@ -297,7 +297,7 @@
         props = ['id'] + props_without_id
 
         # do the edit
-        rows = io_.StringIO(self.form['rows'].value)
+        rows = io_.BytesIO(self.form['rows'].value)
         reader = csv.reader(rows)
         found = {}
         line = 0

Roundup Issue Tracker: http://roundup-tracker.org/