Re: Unicode, stdout, and stderr

2014-07-22 Thread Akira Li
"Frank Millman" writes: > "Steven D'Aprano" wrote in message > news:53ce0b96$0$29897$c3e8da3$54964...@news.astraweb.com... >> On Tue, 22 Jul 2014 08:18:08 +0200, Frank Millman wrote: >> >>> This is not important, but I would appreciate it if someone could >>> explain the following, run from cmd

Re: Unicode, stdout, and stderr

2014-07-22 Thread Terry Reedy
On 7/22/2014 2:18 AM, Frank Millman wrote: Hi all This is not important, but I would appreciate it if someone could explain the following, run from cmd.exe on Windows Server 2003 - C:\>python Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (In tel)] on win32 Type "h

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Peter Otten" <__pete...@web.de> wrote in message news:lql9oi$hlt$1...@ger.gmane.org... > Frank Millman wrote: > [...] > >> Out of interest, does the same thing happen when writing to sys.stderr? > > If you are asking about the fallback mechanism, that is specific to > sys.displayhook in the inte

Re: Unicode, stdout, and stderr

2014-07-22 Thread Peter Otten
Frank Millman wrote: > > "Peter Otten" <__pete...@web.de> wrote in message > news:lql3am$2q7$1...@ger.gmane.org... >> Frank Millman wrote: >> >>> Hi all >>> >>> This is not important, but I would appreciate it if someone could >>> explain the following, run from cmd.exe on Windows Server 2003 - >

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Peter Otten" <__pete...@web.de> wrote in message news:lql3am$2q7$1...@ger.gmane.org... > Frank Millman wrote: > >> Hi all >> >> This is not important, but I would appreciate it if someone could explain >> the following, run from cmd.exe on Windows Server 2003 - >> >> C:\>python >> Python 3.4.1 (

Re: Unicode, stdout, and stderr

2014-07-22 Thread Lele Gaifax
Peter Otten <__pete...@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) > >

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Lele Gaifax" wrote in message news:87d2cx271o.fsf@nautilus.nautilus... > "Frank Millman" writes: > >>> No, both statements actually emit noise on the standard output, but the >>> former prints the *repr* of the string, the latter tries to encode it to >>> CP437, which you console seems to be u

Re: Unicode, stdout, and stderr

2014-07-22 Thread Lele Gaifax
"Frank Millman" writes: > "Steven D'Aprano" wrote in message > news:53ce0b96$0$29897$c3e8da3$54964...@news.astraweb.com... >> I would be surprised if that were the case, but I don't have a Windows >> box to test it. Try this: >> >> >> import sys >> print(x, file=sys.stderr) # I expect this wil

Re: Unicode, stdout, and stderr

2014-07-22 Thread Lele Gaifax
"Frank Millman" writes: >> No, both statements actually emit noise on the standard output, but the >> former prints the *repr* of the string, the latter tries to encode it to >> CP437, which you console seems to be using. >> > > Thanks, Lele, but I don't think that is quite right - see my separat

Re: Unicode, stdout, and stderr

2014-07-22 Thread Peter Otten
Frank Millman wrote: > Hi all > > This is not important, but I would appreciate it if someone could explain > the following, run from cmd.exe on Windows Server 2003 - > > C:\>python > Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 > bit (In > tel)] on win32 > Type "help

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Steven D'Aprano" wrote in message news:53ce0b96$0$29897$c3e8da3$54964...@news.astraweb.com... > On Tue, 22 Jul 2014 08:18:08 +0200, Frank Millman wrote: > >> Hi all >> >> This is not important, but I would appreciate it if someone could >> explain the following, run from cmd.exe on Windows Serv

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Lele Gaifax" wrote in message news:87lhrl28ie.fsf@nautilus.nautilus... > "Frank Millman" writes: > >> Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 >> bit >> (In >> tel)] on win32 >> Type "help", "copyright", "credits" or "license" for more information. > x = '\

Re: Unicode, stdout, and stderr

2014-07-22 Thread Steven D'Aprano
On Tue, 22 Jul 2014 08:18:08 +0200, Frank Millman wrote: > Hi all > > This is not important, but I would appreciate it if someone could > explain the following, run from cmd.exe on Windows Server 2003 - > > C:\>python > Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 > b

Re: Unicode, stdout, and stderr

2014-07-21 Thread Lele Gaifax
"Frank Millman" writes: > Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit > (In > tel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. x = '\u2119' x # this uses stderr > '\u2119' print(x) # this uses stdout > Trace

Unicode, stdout, and stderr

2014-07-21 Thread Frank Millman
Hi all This is not important, but I would appreciate it if someone could explain the following, run from cmd.exe on Windows Server 2003 - C:\>python Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" f