Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #59860 > unrolled thread
| Started by | Nick Coghlan <ncoghlan@gmail.com> |
|---|---|
| First post | 2013-11-18 22:59 +1000 |
| Last post | 2013-11-18 22:59 +1000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [Python-ideas] Unicode stdin/stdout Nick Coghlan <ncoghlan@gmail.com> - 2013-11-18 22:59 +1000
| From | Nick Coghlan <ncoghlan@gmail.com> |
|---|---|
| Date | 2013-11-18 22:59 +1000 |
| Subject | Re: [Python-ideas] Unicode stdin/stdout |
| Message-ID | <mailman.2841.1384779566.18130.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
On 18 Nov 2013 22:36, "Robin Becker" <robin@reportlab.com> wrote:
>
> 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'
Note that calling detach() on the standard streams isn't officially
supported, since it breaks the shadow streams saved in sys.__stderr__, etc.
Cheers,
Nick.
>
> --
> Robin Becker
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
Back to top | Article view | comp.lang.python
csiph-web