From e0cdb267de9cd6a9f227387b0c4189ddb25e312d Mon Sep 17 00:00:00 2001 From: MinRK Date: Mon, 21 May 2012 22:07:47 -0700 Subject: [PATCH] fix date objects in _reserialize_reply --- IPython/frontend/html/notebook/handlers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/IPython/frontend/html/notebook/handlers.py b/IPython/frontend/html/notebook/handlers.py index 62b3b8275..92752a555 100644 --- a/IPython/frontend/html/notebook/handlers.py +++ b/IPython/frontend/html/notebook/handlers.py @@ -30,6 +30,7 @@ from zmq.utils import jsonapi from IPython.external.decorator import decorator from IPython.zmq.session import Session from IPython.lib.security import passwd_check +from IPython.utils.jsonutil import date_default try: from docutils.core import publish_string @@ -385,13 +386,13 @@ class ZMQStreamHandler(websocket.WebSocketHandler): except KeyError: pass msg.pop('buffers') - return jsonapi.dumps(msg) + return jsonapi.dumps(msg, default=date_default) def _on_zmq_reply(self, msg_list): try: msg = self._reserialize_reply(msg_list) - except: - self.application.log.critical("Malformed message: %r" % msg_list) + except Exception: + self.application.log.critical("Malformed message: %r" % msg_list, exc_info=True) else: self.write_message(msg)