cpython: c06b94c5c609 (original) (raw)

Mercurial > cpython

changeset 75641:c06b94c5c609

Issue #14200: Idle shell crash on printing non-BMP unicode character. UnicodeEncodeError is raised for strings contains non-BMP characters. For eval results unicode escaping is used, print() calls display exception with traceback as usual. [#14200]

Andrew Svetlov andrew.svetlov@gmail.com
date Wed, 14 Mar 2012 13:22:12 -0700
parents 7cbc48324938
children e6baf63f2f15
files Lib/idlelib/PyShell.py Lib/idlelib/rpc.py Lib/idlelib/run.py Misc/NEWS
diffstat 4 files changed, 40 insertions(+), 0 deletions(-)[+] [-] Lib/idlelib/PyShell.py 10 Lib/idlelib/rpc.py 7 Lib/idlelib/run.py 21 Misc/NEWS 2

line wrap: on

line diff

--- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1221,6 +1221,16 @@ class PyShell(OutputWindow): self.set_line_and_column() def write(self, s, tags=()):

--- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -196,8 +196,12 @@ class SocketIO(object): return ("ERROR", "Unsupported message type: %s" % how) except SystemExit: raise

@@ -257,6 +261,9 @@ class SocketIO(object): if how == "ERROR": self.debug("decoderesponse: Internal ERROR:", what) raise RuntimeError(what)

def decode_interrupthook(self):

--- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -6,6 +6,7 @@ import traceback import _thread as thread import threading import queue +import builtins from idlelib import CallTips from idlelib import AutoComplete @@ -261,6 +262,25 @@ class MyRPCServer(rpc.RPCServer): thread.interrupt_main() +def displayhook(value):

+ + class MyHandler(rpc.RPCHandler): def handle(self): @@ -270,6 +290,7 @@ class MyHandler(rpc.RPCHandler): sys.stdin = self.console = self.get_remote_proxy("stdin") sys.stdout = self.get_remote_proxy("stdout") sys.stderr = self.get_remote_proxy("stderr")

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -24,6 +24,8 @@ Core and Builtins Library ------- +- Issue #14200: Idle shell crash on printing non-BMP unicode character. +