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.
This commit is contained in:
Andrew Svetlov 2012-03-14 13:22:12 -07:00
parent c5ceb0aaaf
commit 05bab93339
4 changed files with 40 additions and 0 deletions

View file

@ -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):