[issue4618] print_function and unicode_literals don't work together

STINNER Victor report at bugs.python.org
Wed Dec 10 14:38:19 CET 2008


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

The TypeError("can't write str to text stream") comes from the newline 
written by builtin_print().

Workaround: print(u"foo", end=u"\n", file=StringIO()).

----------
nosy: +haypo

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


More information about the Python-bugs-list mailing list