summaryrefslogtreecommitdiff
path: root/Lib/idlelib/rpc.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-03-14 13:22:12 -0700
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-03-14 13:22:12 -0700
commit05bab93339308d330d6bd718575212ae2b3dc46d (patch)
treebb17df498b687ce4b5fafaa7f4629a5cfba84851 /Lib/idlelib/rpc.py
parentc5ceb0aaafa3064c8f301ebbedf44f421d3f3eba (diff)
downloadcpython-git-05bab93339308d330d6bd718575212ae2b3dc46d.tar.gz
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.
Diffstat (limited to 'Lib/idlelib/rpc.py')
-rw-r--r--Lib/idlelib/rpc.py7
1 files changed, 7 insertions, 0 deletions
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):