Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ensure replies from ipkernel are clean for JSON

  • Loading branch information...
commit 5a3b97e0ba59da80fb5f90ba0078f0d79cd57606 1 parent e8613d2
@minrk authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 IPython/zmq/ipkernel.py
View
5 IPython/zmq/ipkernel.py
@@ -303,6 +303,7 @@ def execute_request(self, ident, parent):
time.sleep(self._execute_sleep)
# Send the reply.
+ reply_content = json_clean(reply_content)
reply_msg = self.session.send(self.shell_socket, u'execute_reply',
reply_content, parent, ident=ident)
self.log.debug(str(reply_msg))
@@ -321,6 +322,7 @@ def complete_request(self, ident, parent):
matches = {'matches' : matches,
'matched_text' : txt,
'status' : 'ok'}
+ matches = json_clean(matches)
completion_msg = self.session.send(self.shell_socket, 'complete_reply',
matches, parent, ident)
self.log.debug(str(completion_msg))
@@ -358,6 +360,7 @@ def history_request(self, ident, parent):
else:
hist = []
content = {'history' : list(hist)}
+ content = json_clean(content)
msg = self.session.send(self.shell_socket, 'history_reply',
content, parent, ident)
self.log.debug(str(msg))
@@ -409,7 +412,7 @@ def _raw_input(self, prompt, ident, parent):
sys.stdout.flush()
# Send the input request.
- content = dict(prompt=prompt)
+ content = json_clean(dict(prompt=prompt))
msg = self.session.send(self.stdin_socket, u'input_request', content, parent)
# Await a response.
Please sign in to comment.
Something went wrong with that request. Please try again.