From 42ad98e750afd91847f65a7221de665da6585495 Mon Sep 17 00:00:00 2001 From: Eric Seidler Date: Thu, 5 Jan 2017 21:44:07 -0600 Subject: [PATCH] handle failed pickled.loads --- socketio/zmq_manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/socketio/zmq_manager.py b/socketio/zmq_manager.py index 12dfe89..2ad79ce 100644 --- a/socketio/zmq_manager.py +++ b/socketio/zmq_manager.py @@ -102,7 +102,10 @@ class ZmqManager(PubSubManager): # pragma: no cover def _listen(self): for message in self.zmq_listen(): if isinstance(message, str): - message = pickle.loads(message) + try: + message = pickle.loads(message) + except Exception: + pass if isinstance(message, dict) and \ message['type'] == 'message' and \ message['channel'] == self.channel and \