Re: Wrapping stdout in a codec

2007-10-24 Thread JKPeck
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)

Re: Wrapping stdout in a codec

2007-10-21 Thread Marc 'BlackJack' Rintsch
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

RE: Wrapping stdout in a codec

2007-10-21 Thread Ryan Ginstrom
> 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