Author Drekin
Recipients BreamoreBoy, David.Sankel, Drekin, akira, amaury.forgeotdarc, christian.heimes, christoph, davidsarah, ezio.melotti, flox, giampaolo.rodola, hippietrail, lemburg, mark, mhammond, ncoghlan, pitrou, santoso.wijaya, smerlin, sorin, steve.dower, terry.reedy, tim.golden, tzot, v+python, wiz21
Date 2014-09-23.09:35:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411464953.71.0.110373054928.issue1602@psf.upfronthosting.co.za>
In-reply-to
Content
Stefan Champailler:

The crash you see is maybe not a crash at all. First it has nothing to do with printing, the problem is reading of your input line. That explains why Python exited even before printing the traceback of the SyntaxError. If you try to read input using `sys.stdin.buffer.raw.read(100)` and type Unicode characters, it returns just empty bytes `b''`. So maybe Python REPL then thinks the input just ended and so standardly exits the interpreter.

Why are you using chcp 65001? As far as I know, it doesn't give you the ability to use Unicode in the console. It somehow helps with printing, but there are some issues. `print("\N{euro sign}")` prints the right character, but it prints additional blank line. `sys.stdout.write("\N{euro sign}")` and `sys.stdout.buffer.write("\N{euro sign}".encode("cp65001"))` does the same, but `sys.stdout.buffer.raw.write("\N{euro sign}".encode("cp65001"))` works as expected.

If you want to enter and display Unicode in Python on Windows console, try my package `win_unicode_console`, which tries to solve the issues. See https://pypi.python.org/pypi/win_unicode_console.
History
Date User Action Args
2014-09-23 09:35:53Drekinsetrecipients: + Drekin, lemburg, mhammond, terry.reedy, tzot, amaury.forgeotdarc, ncoghlan, pitrou, giampaolo.rodola, christian.heimes, tim.golden, mark, christoph, ezio.melotti, v+python, hippietrail, sorin, flox, davidsarah, santoso.wijaya, akira, BreamoreBoy, David.Sankel, smerlin, steve.dower, wiz21
2014-09-23 09:35:53Drekinsetmessageid: <1411464953.71.0.110373054928.issue1602@psf.upfronthosting.co.za>
2014-09-23 09:35:53Drekinlinkissue1602 messages
2014-09-23 09:35:53Drekincreate