[Python-3000] Does Py3k's print offer any unicode encoding help?

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Feb 16 01:21:12 CET 2008


Adam Olsen wrote:
> That'd rely on prompt deletion for correct behaviour.  Why not an
> explicit detach method?
> 
> buf = sys.stdout.buffer
> sys.stdout.detach()
> sys.stdout = io.TextIOWrapper(buf, "utf-8")

Or keep an explicit count of the number of unclosed
wrappers that are referencing a buffer.

-- 
Greg


More information about the Python-3000 mailing list