Hello community, here is the log from the commit of package python-redis for openSUSE:Factory checked in at 2019-12-07 15:19:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-redis (Old) and /work/SRC/openSUSE:Factory/.python-redis.new.4691 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-redis" Sat Dec 7 15:19:20 2019 rev:25 rq:751836 version:3.3.11 Changes: -------- --- /work/SRC/openSUSE:Factory/python-redis/python-redis.changes 2019-09-23 12:04:45.373931664 +0200 +++ /work/SRC/openSUSE:Factory/.python-redis.new.4691/python-redis.changes 2019-12-07 15:22:56.695732493 +0100 @@ -1,0 +2,20 @@ +Sun Nov 24 17:25:24 UTC 2019 - Arun Persaud <[email protected]> + +- specfile: + * be more specifc in %files section + +- update to version 3.3.11: + * Further fix for the SSLError -> TimeoutError mapping to work on + obscure releases of Python 2.7. + +- changes from version 3.3.10: + * Fixed a potential error handling bug for the SSLError -> + TimeoutError mapping introduced in 3.3.9. hanks @zbristow. #1224 + +- changes from version 3.3.9: + * Mapped Python 2.7 SSLError to TimeoutError where + appropriate. Timeouts should now consistently raise TimeoutErrors + on Python 2.7 for both unsecured and secured connections. Thanks + @zbristow. #1222 + +------------------------------------------------------------------- Old: ---- redis-3.3.8.tar.gz New: ---- redis-3.3.11.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-redis.spec ++++++ --- /var/tmp/diff_new_pack.XYNxBT/_old 2019-12-07 15:22:58.391732259 +0100 +++ /var/tmp/diff_new_pack.XYNxBT/_new 2019-12-07 15:22:58.391732259 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-redis # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-redis -Version: 3.3.8 +Version: 3.3.11 Release: 0 Summary: Python client for Redis key-value store License: MIT @@ -58,6 +58,7 @@ %files %{python_files} %license LICENSE %doc CHANGES README.rst -%{python_sitelib}/* +%{python_sitelib}/redis/ +%{python_sitelib}/redis-%{version}-py*.egg-info %changelog ++++++ redis-3.3.8.tar.gz -> redis-3.3.11.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.8/CHANGES new/redis-3.3.11/CHANGES --- old/redis-3.3.8/CHANGES 2019-08-19 21:31:23.000000000 +0200 +++ new/redis-3.3.11/CHANGES 2019-10-13 17:57:02.000000000 +0200 @@ -1,3 +1,13 @@ +* 3.3.11 + * Further fix for the SSLError -> TimeoutError mapping to work + on obscure releases of Python 2.7. +* 3.3.10 + * Fixed a potential error handling bug for the SSLError -> TimeoutError + mapping introduced in 3.3.9. hanks @zbristow. #1224 +* 3.3.9 + * Mapped Python 2.7 SSLError to TimeoutError where appropriate. Timeouts + should now consistently raise TimeoutErrors on Python 2.7 for both + unsecured and secured connections. Thanks @zbristow. #1222 * 3.3.8 * Fixed MONITOR parsing to properly parse IPv6 client addresses, unix socket connections and commands issued from Lua. Thanks @kukey. #1201 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.8/PKG-INFO new/redis-3.3.11/PKG-INFO --- old/redis-3.3.8/PKG-INFO 2019-08-19 21:39:44.000000000 +0200 +++ new/redis-3.3.11/PKG-INFO 2019-10-13 17:57:24.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: redis -Version: 3.3.8 +Version: 3.3.11 Summary: Python client for Redis key-value store Home-page: https://github.com/andymccurdy/redis-py Author: Andy McCurdy @@ -158,7 +158,7 @@ ZINCRBY ^^^^^^^ - redis-py 2.X accidentily modified the argument order of ZINCRBY, swapping the + redis-py 2.X accidentally modified the argument order of ZINCRBY, swapping the order of value and amount. ZINCRBY now looks like: .. code-block:: pycon @@ -241,7 +241,7 @@ <https://github.com/andymccurdy/redis-py/issues/151#issuecomment-1545015>`_ for details). * **SCAN/SSCAN/HSCAN/ZSCAN**: The \*SCAN commands are implemented as they - exist in the Redis documentation. In addition, each command has an equivilant + exist in the Redis documentation. In addition, each command has an equivalent iterator method. These are purely for convenience so the user doesn't have to keep track of the cursor while iterating. Use the scan_iter/sscan_iter/hscan_iter/zscan_iter methods for this behavior. @@ -311,7 +311,7 @@ liveliness of a connection just before issuing a command. Users can pass ``health_check_interval=N`` to the Redis or ConnectionPool classes or as a query argument within a Redis URL. The value of ``health_check_interval`` - must be an interger. A value of ``0``, the default, disables health checks. + must be an integer. A value of ``0``, the default, disables health checks. Any positive integer will enable health checks. Health checks are performed just before a command is executed if the underlying connection has been idle for more than ``health_check_interval`` seconds. For example, @@ -320,7 +320,7 @@ is executed on that connection. If your application is running in an environment that disconnects idle - connections after 30 seconds you should set the ``heatlh_check_interval`` + connections after 30 seconds you should set the ``health_check_interval`` option to a value less than 30. This option also works on any PubSub connection that is created from a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.8/README.rst new/redis-3.3.11/README.rst --- old/redis-3.3.8/README.rst 2019-07-28 23:12:33.000000000 +0200 +++ new/redis-3.3.11/README.rst 2019-10-10 23:04:42.000000000 +0200 @@ -148,7 +148,7 @@ ZINCRBY ^^^^^^^ -redis-py 2.X accidentily modified the argument order of ZINCRBY, swapping the +redis-py 2.X accidentally modified the argument order of ZINCRBY, swapping the order of value and amount. ZINCRBY now looks like: .. code-block:: pycon @@ -231,7 +231,7 @@ <https://github.com/andymccurdy/redis-py/issues/151#issuecomment-1545015>`_ for details). * **SCAN/SSCAN/HSCAN/ZSCAN**: The \*SCAN commands are implemented as they - exist in the Redis documentation. In addition, each command has an equivilant + exist in the Redis documentation. In addition, each command has an equivalent iterator method. These are purely for convenience so the user doesn't have to keep track of the cursor while iterating. Use the scan_iter/sscan_iter/hscan_iter/zscan_iter methods for this behavior. @@ -301,7 +301,7 @@ liveliness of a connection just before issuing a command. Users can pass ``health_check_interval=N`` to the Redis or ConnectionPool classes or as a query argument within a Redis URL. The value of ``health_check_interval`` -must be an interger. A value of ``0``, the default, disables health checks. +must be an integer. A value of ``0``, the default, disables health checks. Any positive integer will enable health checks. Health checks are performed just before a command is executed if the underlying connection has been idle for more than ``health_check_interval`` seconds. For example, @@ -310,7 +310,7 @@ is executed on that connection. If your application is running in an environment that disconnects idle -connections after 30 seconds you should set the ``heatlh_check_interval`` +connections after 30 seconds you should set the ``health_check_interval`` option to a value less than 30. This option also works on any PubSub connection that is created from a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.8/redis/__init__.py new/redis-3.3.11/redis/__init__.py --- old/redis-3.3.8/redis/__init__.py 2019-08-19 21:31:23.000000000 +0200 +++ new/redis-3.3.11/redis/__init__.py 2019-10-13 17:57:02.000000000 +0200 @@ -29,7 +29,7 @@ return value -__version__ = '3.3.8' +__version__ = '3.3.11' VERSION = tuple(map(int_or_str, __version__.split('.'))) __all__ = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.8/redis/_compat.py new/redis-3.3.11/redis/_compat.py --- old/redis-3.3.8/redis/_compat.py 2019-07-10 02:05:05.000000000 +0200 +++ new/redis-3.3.11/redis/_compat.py 2019-10-13 17:57:02.000000000 +0200 @@ -3,6 +3,19 @@ import socket import sys + +def sendall(sock, *args, **kwargs): + return sock.sendall(*args, **kwargs) + + +def shutdown(sock, *args, **kwargs): + return sock.shutdown(*args, **kwargs) + + +def ssl_wrap_socket(context, sock, *args, **kwargs): + return context.wrap_socket(sock, *args, **kwargs) + + # For Python older than 3.5, retry EINTR. if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] < 5): @@ -61,6 +74,44 @@ return sock.recv_into(*args, **kwargs) if sys.version_info[0] < 3: + # In Python 3, the ssl module raises socket.timeout whereas it raises + # SSLError in Python 2. For compatibility between versions, ensure + # socket.timeout is raised for both. + import functools + + try: + from ssl import SSLError as _SSLError + except ImportError: + class _SSLError(Exception): + """A replacement in case ssl.SSLError is not available.""" + pass + + _EXPECTED_SSL_TIMEOUT_MESSAGES = ( + "The handshake operation timed out", + "The read operation timed out", + "The write operation timed out", + ) + + def _handle_ssl_timeout(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + return func(*args, **kwargs) + except _SSLError as e: + message = len(e.args) == 1 and unicode(e.args[0]) or '' + if any(x in message for x in _EXPECTED_SSL_TIMEOUT_MESSAGES): + # Raise socket.timeout for compatibility with Python 3. + raise socket.timeout(*e.args) + raise + return wrapper + + recv = _handle_ssl_timeout(recv) + recv_into = _handle_ssl_timeout(recv_into) + sendall = _handle_ssl_timeout(sendall) + shutdown = _handle_ssl_timeout(shutdown) + ssl_wrap_socket = _handle_ssl_timeout(ssl_wrap_socket) + +if sys.version_info[0] < 3: from urllib import unquote from urlparse import parse_qs, urlparse from itertools import imap, izip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.8/redis/connection.py new/redis-3.3.11/redis/connection.py --- old/redis-3.3.8/redis/connection.py 2019-08-19 21:17:14.000000000 +0200 +++ new/redis-3.3.11/redis/connection.py 2019-10-10 23:11:31.000000000 +0200 @@ -13,7 +13,8 @@ from redis._compat import (xrange, imap, byte_to_chr, unicode, long, nativestr, basestring, iteritems, LifoQueue, Empty, Full, urlparse, parse_qs, - recv, recv_into, unquote, BlockingIOError) + recv, recv_into, unquote, BlockingIOError, + sendall, shutdown, ssl_wrap_socket) from redis.exceptions import ( AuthenticationError, BusyLoadingError, @@ -630,7 +631,7 @@ return try: if os.getpid() == self.pid: - self._sock.shutdown(socket.SHUT_RDWR) + shutdown(self._sock, socket.SHUT_RDWR) self._sock.close() except socket.error: pass @@ -662,7 +663,7 @@ if isinstance(command, str): command = [command] for item in command: - self._sock.sendall(item) + sendall(self._sock, item) except socket.timeout: self.disconnect() raise TimeoutError("Timeout writing to socket") @@ -815,11 +816,12 @@ keyfile=self.keyfile) if self.ca_certs: context.load_verify_locations(self.ca_certs) - sock = context.wrap_socket(sock, server_hostname=self.host) + sock = ssl_wrap_socket(context, sock, server_hostname=self.host) else: # In case this code runs in a version which is older than 2.7.9, # we want to fall back to old code - sock = ssl.wrap_socket(sock, + sock = ssl_wrap_socket(ssl, + sock, cert_reqs=self.cert_reqs, keyfile=self.keyfile, certfile=self.certfile, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.8/redis.egg-info/PKG-INFO new/redis-3.3.11/redis.egg-info/PKG-INFO --- old/redis-3.3.8/redis.egg-info/PKG-INFO 2019-08-19 21:39:44.000000000 +0200 +++ new/redis-3.3.11/redis.egg-info/PKG-INFO 2019-10-13 17:57:23.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: redis -Version: 3.3.8 +Version: 3.3.11 Summary: Python client for Redis key-value store Home-page: https://github.com/andymccurdy/redis-py Author: Andy McCurdy @@ -158,7 +158,7 @@ ZINCRBY ^^^^^^^ - redis-py 2.X accidentily modified the argument order of ZINCRBY, swapping the + redis-py 2.X accidentally modified the argument order of ZINCRBY, swapping the order of value and amount. ZINCRBY now looks like: .. code-block:: pycon @@ -241,7 +241,7 @@ <https://github.com/andymccurdy/redis-py/issues/151#issuecomment-1545015>`_ for details). * **SCAN/SSCAN/HSCAN/ZSCAN**: The \*SCAN commands are implemented as they - exist in the Redis documentation. In addition, each command has an equivilant + exist in the Redis documentation. In addition, each command has an equivalent iterator method. These are purely for convenience so the user doesn't have to keep track of the cursor while iterating. Use the scan_iter/sscan_iter/hscan_iter/zscan_iter methods for this behavior. @@ -311,7 +311,7 @@ liveliness of a connection just before issuing a command. Users can pass ``health_check_interval=N`` to the Redis or ConnectionPool classes or as a query argument within a Redis URL. The value of ``health_check_interval`` - must be an interger. A value of ``0``, the default, disables health checks. + must be an integer. A value of ``0``, the default, disables health checks. Any positive integer will enable health checks. Health checks are performed just before a command is executed if the underlying connection has been idle for more than ``health_check_interval`` seconds. For example, @@ -320,7 +320,7 @@ is executed on that connection. If your application is running in an environment that disconnects idle - connections after 30 seconds you should set the ``heatlh_check_interval`` + connections after 30 seconds you should set the ``health_check_interval`` option to a value less than 30. This option also works on any PubSub connection that is created from a
