> is there any reason why "print" cannot pass unicode > strings on to the underlying write method? Mostly because there is no guarantee that every .write method will support Unicode objects. I see two options: either a stream might declare itself as supporting unicode on output (by, say, providing a unicode attribute), or all streams are required by BDFL pronouncement to accept Unicode objects. BTW, your wrapper example can be rewritten as import sys,codecs sys.stdout = codecs.lookup("iso-8859-1")[3](sys.stdout) I wish codecs.lookup returned a record with named fields, instead of a list, so I could write sys.stdout = codecs.lookup("iso-8859-1").writer(sys.stdout) (the other field names would be encode,decode, and reader). 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