On Mon, 22 Oct 2007 02:41:17 +0000, JKPeck wrote: > We want to wrap the stdout device in a codec in order to decode output > transparently according to a particular code page (which might not be > the system code page). However, codec.open requires a filename, and > stdout may be a tty or otherwise anonymous. How can we accomplish > this wrapping?
The `codecs` module has more than just the `codecs.open()` function. Try something like this:: sys.stdout = codecs.getwriter('utf-8')(sys.stdout) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list