From fd95aabd706b93b3b8862a9ae0cc1cc3c656d04c Mon Sep 17 00:00:00 2001 From: liris Date: Fri, 25 Apr 2014 12:29:37 +0900 Subject: - fixed #80 --- README.rst | 5 +++++ setup.py | 2 +- websocket/__init__.py | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 5792a36..966645c 100644 --- a/README.rst +++ b/README.rst @@ -127,6 +127,11 @@ example:: ChangeLog ============ + +- v0.13.1 + + - fix backword compatibility for WebSocketApp on Python 3(ISSUE#80) + - v0.13.0 - MemoryError when receiving large amount of data (~60 MB) at once(ISSUE#59) diff --git a/setup.py b/setup.py index bd2cdea..92302ac 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -VERSION = "0.13.0" +VERSION = "0.13.1" setup( diff --git a/websocket/__init__.py b/websocket/__init__.py index 2607549..66de4dc 100644 --- a/websocket/__init__.py +++ b/websocket/__init__.py @@ -972,7 +972,10 @@ class WebSocketApp(object): elif op_code == ABNF.OPCODE_CONT and self.on_cont_message: self._callback(self.on_cont_message, frame.data, frame.fin) else: - self._callback(self.on_message, frame.data) + data = frame.data + if frame.opcode == ABNF.OPCODE_TEXT: + data = data.decode("utf-8") + self._callback(self.on_message, data) except Exception as e: self._callback(self.on_error, e) finally: -- cgit v1.2.1