diff options
author | liris <liris.pp@gmail.com> | 2014-04-25 12:29:37 +0900 |
---|---|---|
committer | liris <liris.pp@gmail.com> | 2014-04-25 12:29:37 +0900 |
commit | fd95aabd706b93b3b8862a9ae0cc1cc3c656d04c (patch) | |
tree | e1889ab8f9bf834ce83095961178de37baf02854 | |
parent | e197939d13361706a6773c64bdc451cf59e49189 (diff) | |
download | websocket-client-old_py3.tar.gz |
- fixed #80v0.13.1-py3py3old_py3
-rw-r--r-- | README.rst | 5 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | websocket/__init__.py | 5 |
3 files changed, 10 insertions, 2 deletions
@@ -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) @@ -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: |