[issue2387] cStringIO and unicode

Florent Xicluna report at bugs.python.org
Fri Apr 27 09:28:24 CEST 2012


Florent Xicluna <florent.xicluna at gmail.com> added the comment:

It seems the documentation is not enough accurate.

"Unlike the StringIO module, this module is not able to accept Unicode strings that cannot be encoded as plain ASCII strings."

I understand that u'foo' can be encoded as plan ASCII, however it does not behave correctly with cStringIO.


Python 2.7.3 (default, Apr 14 2012, 01:49:35) 
>>> from cStringIO import StringIO
>>> StringIO(u'foo').read()
'f\x00o\x00o\x00'
>>>

----------
nosy: +flox
resolution: rejected -> 
status: closed -> open
versions: +Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2387>
_______________________________________


More information about the Python-bugs-list mailing list