"M.-A. Lemburg" <mal@lemburg.com> writes: > StringIO should be considered a non-Unicode aware stream, > so it should not implement .encoding. Instead, PyFile_WriteObject() > will simply call __str__ on the Unicode object and thus use > the default encoding for conversion (this is what StringIO > does currently). This is not what StringIO does currently: >>> s=StringIO.StringIO() >>> print >>s,u"Hallo" >>> s.getvalue() u'Hallo\n' print special-cases Unicode objects and passes them to the stream. So printing Unicode objects on a StringIO builds up a Unicode value. > If somebody wants to use a StringIO object as Unicode aware > stream StringIO *is* Unicode-aware. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4