From fb3b66115ea7220d59ad307c42110b7ec45a172a Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Fri, 15 May 2015 22:47:15 -0400 Subject: [PATCH 01/14] Fix #74 thanks to @Nabla128k --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 9a20e0b..2b25451 100644 --- a/README.rst +++ b/README.rst @@ -6,6 +6,8 @@ socketIO-client =============== Here is a `socket.io `_ client library for Python. You can use it to write test code for your socket.io server. +Please note that this version implements `socket.io protocol 1.x `_, which is not backwards compatible. If you want to communicate using `socket.io protocol 0.9 `_ (e.g. `gevent-socketio `_), please use `socketIO-client 0.5.5 `. + Installation ------------ From 829e6694030f339fa26845b443ff16f5dcd77644 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Fri, 15 May 2015 22:48:33 -0400 Subject: [PATCH 02/14] Fix link --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2b25451..017cb3b 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ socketIO-client =============== Here is a `socket.io `_ client library for Python. You can use it to write test code for your socket.io server. -Please note that this version implements `socket.io protocol 1.x `_, which is not backwards compatible. If you want to communicate using `socket.io protocol 0.9 `_ (e.g. `gevent-socketio `_), please use `socketIO-client 0.5.5 `. +Please note that this version implements `socket.io protocol 1.x `_, which is not backwards compatible. If you want to communicate using `socket.io protocol 0.9 `_ (e.g. `gevent-socketio `_), please use `socketIO-client 0.5.5 `_. Installation From 12fa6c523b77a2a05d14c3741d33eb2b3cbcc53c Mon Sep 17 00:00:00 2001 From: Matt Porritt Date: Tue, 19 May 2015 15:09:22 +1000 Subject: [PATCH 03/14] explicitly set file open to user utf8 encoding when setup.py parses README and CHANGES file. If this is not done some systems will throw unicode can't decode byte error --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0b6a1a7..73c80d5 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ REQUIREMENTS = [ HERE = dirname(abspath(__file__)) -DESCRIPTION = '\n\n'.join(open(join(HERE, _)).read() for _ in [ +DESCRIPTION = '\n\n'.join(open(join(HERE, _), encoding="utf8").read() for _ in [ 'README.rst', 'CHANGES.rst', ]) From 29a3e0ebf69531357d832d6014d15a3fe2f76682 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Wed, 20 May 2015 23:12:11 -0400 Subject: [PATCH 04/14] Support Python 2.6 & 2.7 --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 73c80d5..b27975b 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import io from os.path import abspath, dirname, join from setuptools import find_packages, setup @@ -10,7 +11,8 @@ REQUIREMENTS = [ HERE = dirname(abspath(__file__)) -DESCRIPTION = '\n\n'.join(open(join(HERE, _), encoding="utf8").read() for _ in [ +LOAD_TEXT = lambda name: io.open(join(HERE, name), encoding='UTF-8').read() +DESCRIPTION = '\n\n'.join(LOAD_TEXT(_) for _ in [ 'README.rst', 'CHANGES.rst', ]) From 689648ba32840bf82207548d5c0813b6d823b3ee Mon Sep 17 00:00:00 2001 From: Matt Porritt Date: Fri, 22 May 2015 17:11:21 +1000 Subject: [PATCH 05/14] fixing close method that is called as part of __del__. No longer throws error trying to call an attribute that will not exist if object fails during instantiation --- socketIO_client/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/socketIO_client/__init__.py b/socketIO_client/__init__.py index dfe41e5..3d8d476 100644 --- a/socketIO_client/__init__.py +++ b/socketIO_client/__init__.py @@ -173,7 +173,10 @@ class EngineIO(LoggingMixin): def _close(self): self._wants_to_close = True - self._heartbeat_thread.halt() + try: + self._heartbeat_thread.halt() + except AttributeError: + pass if not self._opened: return engineIO_packet_type = 1 From 59dcd02a91657f2dca838fc463571fcbb134142e Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Mon, 1 Jun 2015 14:31:46 -0400 Subject: [PATCH 06/14] Prepare for minor release --- CHANGES.rst | 9 +++++++++ README.rst | 4 ++-- setup.py | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2839626..cf4bf4a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,8 @@ +0.6.4 +----- +- Fixed support for Python 3 +- Fixed thread cleanup + 0.6.3 ----- - Upgraded to socket.io protocol 1.x for websocket transport @@ -8,6 +13,10 @@ ----- - Upgraded to socket.io protocol 1.x thanks to Sean Arietta and Joe Palmer +0.5.6 +----- +- Backported to support requests 0.8.2 + 0.5.5 ----- - Fixed reconnection in the event of server restart diff --git a/README.rst b/README.rst index 017cb3b..4f544b2 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ socketIO-client =============== Here is a `socket.io `_ client library for Python. You can use it to write test code for your socket.io server. -Please note that this version implements `socket.io protocol 1.x `_, which is not backwards compatible. If you want to communicate using `socket.io protocol 0.9 `_ (e.g. `gevent-socketio `_), please use `socketIO-client 0.5.5 `_. +Please note that this version implements `socket.io protocol 1.x `_, which is not backwards compatible. If you want to communicate using `socket.io protocol 0.9 `_ (which is compatible with `gevent-socketio `_), please use `socketIO-client 0.5.6 `_. Installation @@ -166,5 +166,5 @@ Credits - `Alexandre Bourget `_ wrote `gevent-socketio `_, which is a socket.io server written in Python. - `Paul Kienzle `_, `Zac Lee `_, `Josh VanderLinden `_, `Ian Fitzpatrick `_, `Lucas Klein `_, `Rui Chicoria `_, `Travis Odom `_, `Patrick Huber `_, `Brad Campbell `_, `Daniel `_, `Sean Arietta `_ submitted code to expand support of the socket.io protocol. - `Bernard Pratz `_, `Francis Bull `_ wrote prototypes to support xhr-polling and jsonp-polling. -- `Eric Chen `_, `Denis Zinevich `_, `Thiago Hersan `_, `Nayef Copty `_, `Jörgen Karlsson `_, `Branden Ghena `_ suggested ways to make the connection more robust. +- `Eric Chen `_, `Denis Zinevich `_, `Thiago Hersan `_, `Nayef Copty `_, `Jörgen Karlsson `_, `Branden Ghena `_, `Tim Landscheidt `_, `Matt Porritt `_ suggested ways to make the connection more robust. - `Merlijn van Deen `_, `Frederic Sureau `_, `Marcus Cobden `_, `Drew Hutchison `_, `wuurrd `_, `Adam Kecer `_, `Alex Monk `_, `Vishal P R `_, `John Vandenberg `_, `Thomas Grainger `_ proposed changes that make the library more friendly and practical for you! diff --git a/setup.py b/setup.py index b27975b..8b0f71b 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ DESCRIPTION = '\n\n'.join(LOAD_TEXT(_) for _ in [ ]) setup( name='socketIO_client', - version='0.6.3', + version='0.6.4', description='A socket.io client library', long_description=DESCRIPTION, license='MIT', From ba82ffe5586f61324f3af4169e34c2ffff913168 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Mon, 1 Jun 2015 15:58:49 -0400 Subject: [PATCH 07/14] Fix #80 --- socketIO_client/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socketIO_client/__init__.py b/socketIO_client/__init__.py index 3d8d476..fbf2c7d 100644 --- a/socketIO_client/__init__.py +++ b/socketIO_client/__init__.py @@ -221,7 +221,7 @@ class EngineIO(LoggingMixin): # Use ping/pong to unblock recv for polling transport self._heartbeat_thread.hurry() # Use timeout to unblock recv for websocket transport - self._transport.set_timeout(seconds) + self._transport.set_timeout(seconds=1) # Listen warning_screen = self._yield_warning_screen(seconds) for elapsed_time in warning_screen: From db59b16e257a68489effa3199a94934607ee4b19 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Mon, 1 Jun 2015 16:06:48 -0400 Subject: [PATCH 08/14] Add documentation --- CHANGES.rst | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index cf4bf4a..8970d11 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,7 @@ +0.6.5 +----- +- Updated wait loop to be more responsive under websocket transport + 0.6.4 ----- - Fixed support for Python 3 diff --git a/setup.py b/setup.py index 8b0f71b..8dc5016 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ DESCRIPTION = '\n\n'.join(LOAD_TEXT(_) for _ in [ ]) setup( name='socketIO_client', - version='0.6.4', + version='0.6.5', description='A socket.io client library', long_description=DESCRIPTION, license='MIT', From 1cd63a031bba986f2be5ed6d46480c7fc9f28608 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Mon, 1 Jun 2015 16:16:32 -0400 Subject: [PATCH 09/14] Add classifier --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 8dc5016..a2a00e3 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,7 @@ setup( 'Intended Audience :: Developers', 'Programming Language :: Python', 'License :: OSI Approved :: MIT License', + 'Development Status :: 5 - Production/Stable', ], keywords='socket.io node.js', author='Roy Hyunjin Han', From fd88b9e0960222f01d11a513a0e7a8721badd90e Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Thu, 22 Oct 2015 17:41:21 -0400 Subject: [PATCH 10/14] Prepare for updates --- LICENSE | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 4e68cea..dca6c1b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,19 @@ Copyright (c) 2013 Roy Hyunjin Han and contributors -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. From 4f04e6ca6249357c0dc390f61ed0b68186511c27 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Mon, 2 Nov 2015 16:13:35 -0500 Subject: [PATCH 11/14] Replace basestring with str --- socketIO_client/transports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socketIO_client/transports.py b/socketIO_client/transports.py index f4b4a7c..c2ca31b 100644 --- a/socketIO_client/transports.py +++ b/socketIO_client/transports.py @@ -129,7 +129,7 @@ class WebsocketTransport(AbstractTransport): proxy_url_pack.username, proxy_url_pack.password) if http_session.verify: if http_session.cert: # Specify certificate path on disk - if isinstance(http_session.cert, basestring): + if isinstance(http_session.cert, str): kw['ca_certs'] = http_session.cert else: kw['ca_certs'] = http_session.cert[0] From 7e9f3c734331d1e72beabde9afbe42b135fe0378 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Tue, 10 Nov 2015 17:42:40 -0500 Subject: [PATCH 12/14] Use six.string_types --- socketIO_client/transports.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/socketIO_client/transports.py b/socketIO_client/transports.py index c2ca31b..58824a1 100644 --- a/socketIO_client/transports.py +++ b/socketIO_client/transports.py @@ -6,6 +6,7 @@ import sys import threading import time import websocket +from six import string_types from .exceptions import ConnectionError, TimeoutError from .parsers import ( @@ -129,7 +130,7 @@ class WebsocketTransport(AbstractTransport): proxy_url_pack.username, proxy_url_pack.password) if http_session.verify: if http_session.cert: # Specify certificate path on disk - if isinstance(http_session.cert, str): + if isinstance(http_session.cert, string_types): kw['ca_certs'] = http_session.cert else: kw['ca_certs'] = http_session.cert[0] From d3a5839678e0cf66247db5963d12bf48b488c6a9 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Tue, 5 Jan 2016 09:10:16 -0500 Subject: [PATCH 13/14] Process issues --- TODO.goals | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/TODO.goals b/TODO.goals index 4cfdeaf..dc8e0f6 100644 --- a/TODO.goals +++ b/TODO.goals @@ -1,3 +1,11 @@ -Implement rooms #65 +Implement rooms + https://github.com/invisibleroads/socketIO-client/pull/65 + https://github.com/invisibleroads/socketIO-client/issues/72 Implement binary event + https://github.com/invisibleroads/socketIO-client/issues/70 Implement binary ack + https://github.com/invisibleroads/socketIO-client/issues/71 +Backport to support requests 0.8.2 + https://github.com/invisibleroads/socketIO-client/commit/b288d89c15d452a30bfeb00f38494f59f71f5a43 +Check why connected=True after termination + https://github.com/invisibleroads/socketIO-client/issues/80 From 8aa519e095d82660c8277cb5e6228c04d8c3caa6 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Tue, 19 Jan 2016 23:12:33 -0500 Subject: [PATCH 14/14] Order goals --- TODO.goals | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/TODO.goals b/TODO.goals index dc8e0f6..d72b083 100644 --- a/TODO.goals +++ b/TODO.goals @@ -1,11 +1,48 @@ -Implement rooms - https://github.com/invisibleroads/socketIO-client/pull/65 - https://github.com/invisibleroads/socketIO-client/issues/72 -Implement binary event += Consider supporting both protocols in the same library + https://github.com/invisibleroads/socketIO-client/issues/95 +Add binary support + https://github.com/invisibleroads/socketIO-client/pull/85 https://github.com/invisibleroads/socketIO-client/issues/70 -Implement binary ack https://github.com/invisibleroads/socketIO-client/issues/71 -Backport to support requests 0.8.2 + https://github.com/invisibleroads/socketIO-client/issues/91 +Check requests dependency + https://github.com/invisibleroads/socketIO-client/issues/92 + https://github.com/invisibleroads/socketIO-client/pull/93 https://github.com/invisibleroads/socketIO-client/commit/b288d89c15d452a30bfeb00f38494f59f71f5a43 +Check SSL + https://github.com/invisibleroads/socketIO-client/issues/86 + https://github.com/invisibleroads/socketIO-client/pull/87 +Look into invalid namespace handling + https://github.com/invisibleroads/socketIO-client/issues/84 +Check unicode issues + https://github.com/invisibleroads/socketIO-client/issues/81 +Check python3 support for socketIO-client 0.5.6 + https://github.com/invisibleroads/socketIO-client/issues/83 +Check OK assertion + https://github.com/invisibleroads/socketIO-client/issues/99 + https://github.com/invisibleroads/socketIO-client/pull/103 Check why connected=True after termination https://github.com/invisibleroads/socketIO-client/issues/80 + https://github.com/invisibleroads/socketIO-client/issues/98 +Consider catching heartbeat thread exception + https://github.com/invisibleroads/socketIO-client/issues/100 +Check why it blocks when defining a namespace + https://github.com/invisibleroads/socketIO-client/issues/96 +Check why transports are not being set + https://github.com/invisibleroads/socketIO-client/issues/102 +Look at 404 not found error + https://github.com/invisibleroads/socketIO-client/issues/101 +Look at socketio off and socketio once + https://github.com/invisibleroads/socketIO-client/pull/94 +Implement rooms + https://github.com/invisibleroads/socketIO-client/issues/72 + https://github.com/invisibleroads/socketIO-client/pull/65 +Check tests + https://github.com/invisibleroads/socketIO-client/issues/90 +Check whether it works on Windows 8 + https://github.com/invisibleroads/socketIO-client/issues/97 +Add debian packaging support + https://github.com/invisibleroads/socketIO-client/pull/89 + ++ Review issues and pull requests ++ Order issues