[view] Use io.BytesIO as stream for binary views
authorRémi Cardona <remi.cardona@free.fr>
Wed, 30 Jul 2014 22:34:55 +0200
changeset 10211 59a77e8847bc
parent 10210 633d85ba9f72
child 10212 dccce2be3101
[view] Use io.BytesIO as stream for binary views
view.py
--- a/view.py	Fri Jan 16 14:12:49 2015 +0100
+++ b/view.py	Wed Jul 30 22:34:55 2014 +0200
@@ -20,7 +20,7 @@
 __docformat__ = "restructuredtext en"
 _ = unicode
 
-from cStringIO import StringIO
+from io import BytesIO
 from warnings import warn
 from functools import partial
 
@@ -101,7 +101,7 @@
             return
         if w is None:
             if self.binary:
-                self._stream = stream = StringIO()
+                self._stream = stream = BytesIO()
             else:
                 self._stream = stream = UStringIO()
             w = stream.write
@@ -471,7 +471,7 @@
             return
         if w is None:
             if self.binary:
-                self._stream = stream = StringIO()
+                self._stream = stream = BytesIO()
             else:
                 self._stream = stream = HTMLStream(self._cw)
             w = stream.write