[issue22742] IDLE shows traceback when printing non-BMP character

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And with PR 16583 it is now completely fixed. I.e. it can only fail in cases when the regular interactive interpreter fails too. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___

[issue22742] IDLE shows traceback when printing non-BMP character

2019-10-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Printing the unquoted escape representation rather than a replacement char is a bit strange and not what I expect from the python docs. I could see it as a bug. In any case, on Windows, it is the Python REPL that raises, but only for sys.stdout. >>>

[issue22742] IDLE shows traceback when printing non-BMP character

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was fixed for all valid Unicode characters, you can still get an error when print a surrogate character to the stderr on Linux: >>> import sys >>> print('\ud800', file=sys.stderr) Traceback (most recent call last): File "", line 1, in

[issue22742] IDLE shows traceback when printing non-BMP character

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed by PR 16545 (see issue13153). -- nosy: +serhiy.storchaka resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue22742] IDLE shows traceback when printing non-BMP character

2019-04-24 Thread Martin Panter
Martin Panter added the comment: I haven’t looked at the code, but I suspect Idle implements a custom “sys.displayhook”: >>> help(sys.displayhook) Help on function displayhook in module idlelib.rpc: displayhook(value) Override standard display hook to use non-locale encoding >>>

[issue22742] IDLE shows traceback when printing non-BMP character

2019-04-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: On my puzzlement above: repr(s) is a string of 3 characters -- s bracketed by quote characters. print(repr(s)) fails. I am not sure how s gets expanded to the full escape in IDLE. ascii(s) expands all non-ascii and adds extra quotes. Need to check Shell

[issue22742] IDLE shows traceback when printing non-BMP character

2017-06-19 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- assignee: -> terry.reedy components: +IDLE -Library (Lib) versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.4, Python 3.5 ___ Python tracker

[issue22742] IDLE shows traceback when printing non-BMP character

2015-12-06 Thread irdb
Changes by irdb : -- nosy: +irdb ___ Python tracker ___ ___ Python-bugs-list mailing

[issue22742] IDLE shows traceback when printing non-BMP character

2014-10-31 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think Idle should consistently display astral chars with their \U escape. It sometimes does, just not always. s='\U0001f680' s '\U0001f680' str(s) '\U0001f680' repr(s) '\U0001f680' print(s) # gives error above. print(str(s)) #ditto I thought that

[issue22742] IDLE shows traceback when printing non-BMP character

2014-10-27 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: print(\N{ROCKET}) Traceback (most recent call last): File pyshell#1, line 1, in module print(\N{ROCKET}) File idlelib/PyShell.py, line 1352, in write return self.shell.write(s, self.tags) UnicodeEncodeError: 'UCS-2' codec can't encode