From 05bab93339308d330d6bd718575212ae2b3dc46d Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 14 Mar 2012 13:22:12 -0700 Subject: 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. --- Lib/idlelib/rpc.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Lib/idlelib/rpc.py') diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index def43945ae..301305ee90 100644 --- 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 + except KeyboardInterrupt: + raise except socket.error: raise + except Exception as ex: + return ("CALLEXC", ex) except: msg = "*** Internal Error: rpc.py:SocketIO.localcall()\n\n"\ " Object: %s \n Method: %s \n Args: %s\n" @@ -257,6 +261,9 @@ class SocketIO(object): if how == "ERROR": self.debug("decoderesponse: Internal ERROR:", what) raise RuntimeError(what) + if how == "CALLEXC": + self.debug("decoderesponse: Call Exception:", what) + raise what raise SystemError(how, what) def decode_interrupthook(self): -- cgit v1.2.1