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


Groups > comp.lang.python > #74983 > unrolled thread

Re: Unicode, stdout, and stderr

Started byLele Gaifax <lele@metapensiero.it>
First post2014-07-22 09:38 +0200
Last post2014-07-22 09:38 +0200
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.


Contents

  Re: Unicode, stdout, and stderr Lele Gaifax <lele@metapensiero.it> - 2014-07-22 09:38 +0200

#74983 — Re: Unicode, stdout, and stderr

FromLele Gaifax <lele@metapensiero.it>
Date2014-07-22 09:38 +0200
SubjectRe: Unicode, stdout, and stderr
Message-ID<mailman.12171.1406014806.18130.python-list@python.org>
Peter Otten <__peter__@web.de> writes:

> No, both print to stdout, but just
>
>>>> x
>
> is passed to the display hook of the interactive interpreter. This applies 
> repr() and  then tries to print the result. If this fails it makes another 
> effort, roughly (the actual code is written in C)
>
> sys.stdout.buffer.write(repr(x).encode(
>     sys.stdout.encoding, "backslashreplace"))

Ah-moment!

Thanks,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web