On Oct 22, 12:20 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Mon, 22 Oct 2007 02:41:17 +, 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)
On Mon, 22 Oct 2007 02:41:17 +, 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 otherwi
> On Behalf Of JKPeck
> otherwise anonymous. How can we accomplish this wrapping?
> Our application may be loaded into a Python program that has
> already set up stdout.
Do you mean something like this?
import sys
class OutStreamEncoder(object):
"""Wraps a stream with an encoder"""
d