Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #59858

Re: Unicode stdin/stdout

From Robin Becker <robin@reportlab.com>
Subject Re: Unicode stdin/stdout
Date 2013-11-18 12:33 +0000
References <5286054F.6000707@chamonix.reportlab.co.uk> <1384539385.17784.47988289.02AE655C@webmail.messagingengine.com> <5289FE6C.7030007@chamonix.reportlab.co.uk>
Newsgroups comp.lang.python
Message-ID <mailman.2839.1384778046.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 18/11/2013 11:47, Robin Becker wrote:
...........
> #c:\python33\lib\site-packages\sitecustomize.py
> import sys, codecs
> sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
> sys.stderr = codecs.getwriter("utf-8")(sys.stderr.detach())
........
it seems that the above needs extra stuff to make some distutils logging work 
etc etc; so now I'm using sitecustomize.py containing

import sys, codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
sys.stdout.encoding = 'utf8'
sys.stderr = codecs.getwriter("utf-8")(sys.stderr.detach())
sys.stderr.encoding = 'utf8'

-- 
Robin Becker

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Unicode stdin/stdout Robin Becker <robin@reportlab.com> - 2013-11-18 12:33 +0000

csiph-web