From bc4e206ff37c46efecf189b31a2c912b05c4d5ff Mon Sep 17 00:00:00 2001 From: MinRK Date: Fri, 9 Sep 2011 11:05:49 -0700 Subject: [PATCH] json_clean zmqshell replies closes gh-535 --- IPython/zmq/zmqshell.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/IPython/zmq/zmqshell.py b/IPython/zmq/zmqshell.py index ac7df79c2ea..2bbf2a9b0ff 100644 --- a/IPython/zmq/zmqshell.py +++ b/IPython/zmq/zmqshell.py @@ -30,6 +30,7 @@ from IPython.core.magic import MacroToEdit from IPython.core.payloadpage import install_payload_page from IPython.utils import io +from IPython.utils.jsonutil import json_clean from IPython.utils.path import get_py_filename from IPython.utils.traitlets import Instance, Type, Dict, CBool from IPython.utils.warn import warn @@ -69,7 +70,7 @@ def publish(self, source, data, metadata=None): content['data'] = data content['metadata'] = metadata self.session.send( - self.pub_socket, u'display_data', content, + self.pub_socket, u'display_data', json_clean(content), parent=self.parent_header ) @@ -144,7 +145,7 @@ def _showtraceback(self, etype, evalue, stb): dh = self.displayhook # Send exception info over pub socket for other clients than the caller # to pick up - exc_msg = dh.session.send(dh.pub_socket, u'pyerr', exc_content, dh.parent_header) + exc_msg = dh.session.send(dh.pub_socket, u'pyerr', json_clean(exc_content), dh.parent_header) # FIXME - Hack: store exception info in shell object. Right now, the # caller is reading this info after the fact, we need to fix this logic