diff roundup/anypy/io_.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 74476eaac38a
children dfd0bcc947e5
line wrap: on
line diff
--- a/roundup/anypy/io_.py	Fri Jul 15 10:03:37 2011 +0000
+++ b/roundup/anypy/io_.py	Fri Jul 15 12:36:47 2011 +0000
@@ -1,6 +1,7 @@
 
 try:
-    from io import StringIO
+    from io import StringIO, BytesIO
 except:
     from StringIO import StringIO
+    BytesIO = StringIO
 

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