Hello community,
here is the log from the commit of package python-websocket-client for openSUSE:Factory checked in at 2019-04-18 13:57:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-websocket-client (Old)
and /work/SRC/openSUSE:Factory/.python-websocket-client.new.5536 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-websocket-client"
Thu Apr 18 13:57:19 2019 rev:12 rq:694795 version:0.56.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-websocket-client/python-websocket-client.changes 2019-03-29 20:37:14.454632498 +0100
+++ /work/SRC/openSUSE:Factory/.python-websocket-client.new.5536/python-websocket-client.changes 2019-04-18 13:57:43.139981094 +0200
@@ -1,0 +2,12 @@
+Tue Apr 16 11:14:09 UTC 2019 - Tomáš Chvátal
+
+- Update to 0.56.0:
+ * Don't retry sockets with timeout set to 0(#536)
+ * Add response headers in WebSocketBadStatusException (#501)
+ * Manually assigning WebSocket-Version (#506)
+ * SSL socket handling fix (#474)
+ * Let setup.py use the same license as LICENSE file (#517)
+ * Ensure that "timeout" is passed down, when calling WebSocket.connect() (#513)
+ * Retry connect on "Interrupted system call" (#528)
+
+-------------------------------------------------------------------
Old:
----
websocket_client-0.54.0.tar.gz
New:
----
websocket_client-0.56.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-websocket-client.spec ++++++
--- /var/tmp/diff_new_pack.MGUhJ3/_old 2019-04-18 13:57:45.675981940 +0200
+++ /var/tmp/diff_new_pack.MGUhJ3/_new 2019-04-18 13:57:45.679981942 +0200
@@ -24,7 +24,7 @@
%define ssl_match_hostname python-backports.ssl_match_hostname
%endif
Name: python-websocket-client
-Version: 0.54.0
+Version: 0.56.0
Release: 0
Summary: WebSocket client implementation
License: LGPL-2.1-only
++++++ websocket_client-0.54.0.tar.gz -> websocket_client-0.56.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/ChangeLog new/websocket_client-0.56.0/ChangeLog
--- old/websocket_client-0.54.0/ChangeLog 2018-10-28 02:57:10.000000000 +0100
+++ new/websocket_client-0.56.0/ChangeLog 2019-03-21 02:22:50.000000000 +0100
@@ -1,6 +1,19 @@
ChangeLog
============
+- 0.56.0
+
+ - Don't retry sockets with timeout set to 0(#536)
+
+- 0.55.0
+
+ - Add response headers in WebSocketBadStatusException (#501)
+ - Manually assigning WebSocket-Version (#506)
+ - SSL socket handling fix (#474)
+ - Let setup.py use the same license as LICENSE file (#517)
+ - Ensure that "timeout" is passed down, when calling WebSocket.connect() (#513)
+ - Retry connect on "Interrupted system call" (#528)
+
- 0.54.0
- Change license from LGPL to BSD.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/PKG-INFO new/websocket_client-0.56.0/PKG-INFO
--- old/websocket_client-0.54.0/PKG-INFO 2018-11-01 05:35:15.000000000 +0100
+++ new/websocket_client-0.56.0/PKG-INFO 2019-03-21 02:25:33.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: websocket_client
-Version: 0.54.0
+Version: 0.56.0
Summary: WebSocket client for Python. hybi13 is supported.
Home-page: https://github.com/websocket-client/websocket-client.git
Author: liris
@@ -286,7 +286,7 @@
Keywords: websockets
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
-Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
+Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/setup.py new/websocket_client-0.56.0/setup.py
--- old/websocket_client-0.54.0/setup.py 2018-10-28 02:53:20.000000000 +0100
+++ new/websocket_client-0.56.0/setup.py 2019-03-21 02:22:05.000000000 +0100
@@ -3,7 +3,7 @@
from setuptools import setup
import pkg_resources
-VERSION = "0.54.0"
+VERSION = "0.56.0"
NAME = "websocket_client"
install_requires = ["six"]
@@ -47,7 +47,7 @@
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
classifiers=[
"Development Status :: 4 - Beta",
- "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
+ "License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket/__init__.py new/websocket_client-0.56.0/websocket/__init__.py
--- old/websocket_client-0.54.0/websocket/__init__.py 2018-10-28 02:21:38.000000000 +0100
+++ new/websocket_client-0.56.0/websocket/__init__.py 2019-03-21 02:22:13.000000000 +0100
@@ -26,4 +26,4 @@
from ._logging import *
from ._socket import *
-__version__ = "0.54.0"
+__version__ = "0.56.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket/_core.py new/websocket_client-0.56.0/websocket/_core.py
--- old/websocket_client-0.54.0/websocket/_core.py 2018-10-28 02:39:51.000000000 +0100
+++ new/websocket_client-0.56.0/websocket/_core.py 2019-02-23 06:20:40.000000000 +0100
@@ -216,6 +216,9 @@
"socket" - pre-initialized stream socket.
"""
+ # FIXME: "subprotocols" are getting lost, not passed down
+ # FIXME: "header", "cookie", "origin" and "host" too
+ self.sock_opt.timeout = options.get('timeout', self.sock_opt.timeout)
self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options),
options.pop('socket', None))
@@ -425,7 +428,7 @@
except:
pass
- self.shutdown()
+ self.shutdown()
def abort(self):
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket/_exceptions.py new/websocket_client-0.56.0/websocket/_exceptions.py
--- old/websocket_client-0.54.0/websocket/_exceptions.py 2018-08-14 08:42:25.000000000 +0200
+++ new/websocket_client-0.56.0/websocket/_exceptions.py 2018-12-15 06:42:01.000000000 +0100
@@ -74,10 +74,11 @@
WebSocketBadStatusException will be raised when we get bad handshake status code.
"""
- def __init__(self, message, status_code, status_message=None):
+ def __init__(self, message, status_code, status_message=None, resp_headers=None):
msg = message % (status_code, status_message)
super(WebSocketBadStatusException, self).__init__(msg)
self.status_code = status_code
+ self.resp_headers = resp_headers
class WebSocketAddressException(WebSocketException):
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket/_handshake.py new/websocket_client-0.56.0/websocket/_handshake.py
--- old/websocket_client-0.54.0/websocket/_handshake.py 2018-10-28 02:27:40.000000000 +0100
+++ new/websocket_client-0.56.0/websocket/_handshake.py 2018-12-15 06:45:33.000000000 +0100
@@ -115,8 +115,16 @@
headers.append("Origin: http://%s" % hostport)
key = _create_sec_websocket_key()
- headers.append("Sec-WebSocket-Key: %s" % key)
- headers.append("Sec-WebSocket-Version: %s" % VERSION)
+
+ # Append Sec-WebSocket-Key & Sec-WebSocket-Version if not manually specified
+ if not 'header' in options or 'Sec-WebSocket-Key' not in options['header']:
+ key = _create_sec_websocket_key()
+ headers.append("Sec-WebSocket-Key: %s" % key)
+ else:
+ key = options['header']['Sec-WebSocket-Key']
+
+ if not 'header' in options or 'Sec-WebSocket-Version' not in options['header']:
+ headers.append("Sec-WebSocket-Version: %s" % VERSION)
subprotocols = options.get("subprotocols")
if subprotocols:
@@ -149,7 +157,7 @@
def _get_resp_headers(sock, success_statuses=(101, 301, 302, 303)):
status, resp_headers, status_message = read_headers(sock)
if status not in success_statuses:
- raise WebSocketBadStatusException("Handshake status %d %s", status, status_message)
+ raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers)
return status, resp_headers
_HEADERS_TO_CHECK = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket/_http.py new/websocket_client-0.56.0/websocket/_http.py
--- old/websocket_client-0.54.0/websocket/_http.py 2018-11-01 05:12:02.000000000 +0100
+++ new/websocket_client-0.56.0/websocket/_http.py 2019-02-23 06:18:35.000000000 +0100
@@ -166,28 +166,35 @@
sock.setsockopt(*opts)
address = addrinfo[4]
- try:
- sock.connect(address)
- err = None
- except ProxyConnectionError as error:
- err = WebSocketProxyException(str(error))
- err.remote_ip = str(address[0])
- continue
- except socket.error as error:
- error.remote_ip = str(address[0])
+ err = None
+ while not err:
try:
- eConnRefused = (errno.ECONNREFUSED, errno.WSAECONNREFUSED)
- except:
- eConnRefused = (errno.ECONNREFUSED, )
- if error.errno in eConnRefused:
- err = error
+ sock.connect(address)
+ except ProxyConnectionError as error:
+ err = WebSocketProxyException(str(error))
+ err.remote_ip = str(address[0])
continue
+ except socket.error as error:
+ error.remote_ip = str(address[0])
+ try:
+ eConnRefused = (errno.ECONNREFUSED, errno.WSAECONNREFUSED)
+ except:
+ eConnRefused = (errno.ECONNREFUSED, )
+ if error.errno == errno.EINTR:
+ continue
+ elif error.errno in eConnRefused:
+ err = error
+ continue
+ else:
+ raise error
else:
- raise error
+ break
else:
- break
+ continue
+ break
else:
- raise err
+ if err:
+ raise err
return sock
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket/_socket.py new/websocket_client-0.56.0/websocket/_socket.py
--- old/websocket_client-0.54.0/websocket/_socket.py 2018-02-09 08:38:18.000000000 +0100
+++ new/websocket_client-0.56.0/websocket/_socket.py 2019-03-21 02:20:51.000000000 +0100
@@ -19,6 +19,8 @@
Boston, MA 02110-1335 USA
"""
+import errno
+import select
import socket
import six
@@ -77,8 +79,27 @@
if not sock:
raise WebSocketConnectionClosedException("socket is already closed.")
+ def _recv():
+ try:
+ return sock.recv(bufsize)
+ except SSLWantReadError:
+ pass
+ except socket.error as exc:
+ error_code = extract_error_code(exc)
+ if error_code is None:
+ raise
+ if error_code != errno.EAGAIN or error_code != errno.EWOULDBLOCK:
+ raise
+
+ r, w, e = select.select((sock, ), (), (), sock.gettimeout())
+ if r:
+ return sock.recv(bufsize)
+
try:
- bytes_ = sock.recv(bufsize)
+ if sock.gettimeout() == 0:
+ bytes_ = sock.recv(bufsize)
+ else:
+ bytes_ = _recv()
except socket.timeout as e:
message = extract_err_message(e)
raise WebSocketTimeoutException(message)
@@ -113,8 +134,27 @@
if not sock:
raise WebSocketConnectionClosedException("socket is already closed.")
+ def _send():
+ try:
+ return sock.send(data)
+ except SSLWantWriteError:
+ pass
+ except socket.error as exc:
+ error_code = extract_error_code(exc)
+ if error_code is None:
+ raise
+ if error_code != errno.EAGAIN or error_code != errno.EWOULDBLOCK:
+ raise
+
+ r, w, e = select.select((), (sock, ), (), sock.gettimeout())
+ if w:
+ return sock.send(data)
+
try:
- return sock.send(data)
+ if sock.gettimeout() == 0:
+ return sock.send(data)
+ else:
+ return _send()
except socket.timeout as e:
message = extract_err_message(e)
raise WebSocketTimeoutException(message)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket/_ssl_compat.py new/websocket_client-0.56.0/websocket/_ssl_compat.py
--- old/websocket_client-0.54.0/websocket/_ssl_compat.py 2017-08-11 10:10:58.000000000 +0200
+++ new/websocket_client-0.56.0/websocket/_ssl_compat.py 2019-02-23 06:06:12.000000000 +0100
@@ -19,11 +19,13 @@
Boston, MA 02110-1335 USA
"""
-__all__ = ["HAVE_SSL", "ssl", "SSLError"]
+__all__ = ["HAVE_SSL", "ssl", "SSLError", "SSLWantReadError", "SSLWantWriteError"]
try:
import ssl
from ssl import SSLError
+ from ssl import SSLWantReadError
+ from ssl import SSLWantWriteError
if hasattr(ssl, 'SSLContext') and hasattr(ssl.SSLContext, 'check_hostname'):
HAVE_CONTEXT_CHECK_HOSTNAME = True
else:
@@ -41,4 +43,10 @@
class SSLError(Exception):
pass
+ class SSLWantReadError(Exception):
+ pass
+
+ class SSLWantWriteError(Exception):
+ pass
+
HAVE_SSL = False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket/_utils.py new/websocket_client-0.56.0/websocket/_utils.py
--- old/websocket_client-0.54.0/websocket/_utils.py 2017-08-11 10:10:58.000000000 +0200
+++ new/websocket_client-0.56.0/websocket/_utils.py 2019-02-23 06:06:12.000000000 +0100
@@ -21,7 +21,7 @@
"""
import six
-__all__ = ["NoLock", "validate_utf8", "extract_err_message"]
+__all__ = ["NoLock", "validate_utf8", "extract_err_message", "extract_error_code"]
class NoLock(object):
@@ -103,3 +103,8 @@
return exception.args[0]
else:
return None
+
+
+def extract_error_code(exception):
+ if exception.args and len(exception.args) > 1:
+ return exception.args[0] if isinstance(exception.args[0], int) else None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket/tests/test_websocket.py new/websocket_client-0.56.0/websocket/tests/test_websocket.py
--- old/websocket_client-0.54.0/websocket/tests/test_websocket.py 2018-08-19 12:55:27.000000000 +0200
+++ new/websocket_client-0.56.0/websocket/tests/test_websocket.py 2019-03-21 02:20:51.000000000 +0100
@@ -55,6 +55,9 @@
def add_packet(self, data):
self.data.append(data)
+ def gettimeout(self):
+ return None
+
def recv(self, bufsize):
if self.data:
e = self.data.pop(0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.54.0/websocket_client.egg-info/PKG-INFO new/websocket_client-0.56.0/websocket_client.egg-info/PKG-INFO
--- old/websocket_client-0.54.0/websocket_client.egg-info/PKG-INFO 2018-11-01 05:35:15.000000000 +0100
+++ new/websocket_client-0.56.0/websocket_client.egg-info/PKG-INFO 2019-03-21 02:25:33.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: websocket-client
-Version: 0.54.0
+Version: 0.56.0
Summary: WebSocket client for Python. hybi13 is supported.
Home-page: https://github.com/websocket-client/websocket-client.git
Author: liris
@@ -286,7 +286,7 @@
Keywords: websockets
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
-Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
+Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6