Armin Ronacher added the comment:
To avoid further problems may I also recommend documenting how exactly people
are supposed to wrap sys.stdout and so forth. Clearly putting a StringIO there
is insufficient as StringIO does not have a buffer.
Something like this maybe?
import io
buf = io.BytesIO()
sys.stdout = io.TextIOWrapper(buf,
encoding='utf-8',
errors='strict', # or surrogate-escape as this is the default for stdout
now? not sure
line_buffering=True
)
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21364>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com