uilib.py
changeset 10695 321b99973b69
parent 10689 49a62b8f6d43
child 10702 f94c812c3669
--- a/uilib.py	Tue Sep 22 14:18:14 2015 +0200
+++ b/uilib.py	Wed Sep 16 17:07:26 2015 +0200
@@ -531,7 +531,9 @@
 # csv files / unicode support #################################################
 
 class UnicodeCSVWriter:
-    """proxies calls to csv.writer.writerow to be able to deal with unicode"""
+    """proxies calls to csv.writer.writerow to be able to deal with unicode
+
+    Under Python 3, this code no longer encodes anything."""
 
     def __init__(self, wfunc, encoding, **kwargs):
         self.writer = csv.writer(self, **kwargs)
@@ -542,6 +544,9 @@
         self.wfunc(data)
 
     def writerow(self, row):
+        if PY3:
+            self.writer.writerow(row)
+            return
         csvrow = []
         for elt in row:
             if isinstance(elt, text_type):