From e0f81972a9fbda6a7232352b8d34fe167bbc5c50 Mon Sep 17 00:00:00 2001 From: Nakroma Date: Tue, 13 Jun 2017 15:18:33 +0200 Subject: [PATCH] Added unicode handling fix by MisterWil in PR #158 --- .gitignore | 1 + setup.py | 2 +- socketIO_client/parsers.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e9fc737..a4a5cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ sdist # Vim *.sw[op] *~ +.idea \ No newline at end of file diff --git a/setup.py b/setup.py index efa1787..c9b94de 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ ]) setup( name='socketIO-client', - version='0.7.2', + version='0.7.4', description='A socket.io client library', long_description=DESCRIPTION, license='MIT', diff --git a/socketIO_client/parsers.py b/socketIO_client/parsers.py index bbf28eb..64c66f0 100644 --- a/socketIO_client/parsers.py +++ b/socketIO_client/parsers.py @@ -130,5 +130,5 @@ def _read_packet_length(content, content_index): def _read_packet_text(content, content_index, packet_length): while content.decode()[content_index] == ':': content_index += 1 - packet_text = content[content_index:content_index + packet_length] - return content_index + packet_length, packet_text + packet_text = content.decode()[content_index:content_index + packet_length] + return content_index + packet_length, packet_text.encode()