Hello community, here is the log from the commit of package python-redis for openSUSE:Factory checked in at 2019-09-23 12:04:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-redis (Old) and /work/SRC/openSUSE:Factory/.python-redis.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-redis" Mon Sep 23 12:04:38 2019 rev:24 rq:729802 version:3.3.8 Changes: -------- --- /work/SRC/openSUSE:Factory/python-redis/python-redis.changes 2019-08-14 11:36:49.204702793 +0200 +++ /work/SRC/openSUSE:Factory/.python-redis.new.7948/python-redis.changes 2019-09-23 12:04:45.373931664 +0200 @@ -1,0 +2,7 @@ +Tue Sep 10 10:55:15 UTC 2019 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 3.3.8: + * Fixed MONITOR parsing to properly parse IPv6 client addresses + * Fixed a regression introduced in 3.3.0 + +------------------------------------------------------------------- Old: ---- redis-3.3.6.tar.gz New: ---- redis-3.3.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-redis.spec ++++++ --- /var/tmp/diff_new_pack.Su8Na9/_old 2019-09-23 12:04:47.001931395 +0200 +++ /var/tmp/diff_new_pack.Su8Na9/_new 2019-09-23 12:04:47.001931395 +0200 @@ -18,12 +18,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-redis -Version: 3.3.6 +Version: 3.3.8 Release: 0 Summary: Python client for Redis key-value store License: MIT Group: Development/Languages/Python -URL: http://github.com/andymccurdy/redis-py +URL: https://github.com/andymccurdy/redis-py Source: https://files.pythonhosted.org/packages/source/r/redis/redis-%{version}.tar.gz BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest >= 2.7.0} @@ -32,8 +32,8 @@ BuildRequires: psmisc BuildRequires: python-rpm-macros BuildRequires: redis -Recommends: python-hiredis >= 0.1.3 Requires: redis +Recommends: python-hiredis >= 0.1.3 BuildArch: noarch %python_subpackages ++++++ redis-3.3.6.tar.gz -> redis-3.3.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.6/CHANGES new/redis-3.3.8/CHANGES --- old/redis-3.3.6/CHANGES 2019-08-06 19:59:18.000000000 +0200 +++ new/redis-3.3.8/CHANGES 2019-08-19 21:31:23.000000000 +0200 @@ -1,3 +1,10 @@ +* 3.3.8 + * Fixed MONITOR parsing to properly parse IPv6 client addresses, unix + socket connections and commands issued from Lua. Thanks @kukey. #1201 +* 3.3.7 + * Fixed a regression introduced in 3.3.0 where socket.error exceptions + (or subclasses) could potentially be raised instead of + redis.exceptions.ConnectionError. #1202 * 3.3.6 * Fixed a regression in 3.3.5 that caused PubSub.get_message() to raise a socket.timeout exception when passing a timeout value. #1200 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.6/PKG-INFO new/redis-3.3.8/PKG-INFO --- old/redis-3.3.6/PKG-INFO 2019-08-06 20:10:21.000000000 +0200 +++ new/redis-3.3.8/PKG-INFO 2019-08-19 21:39:44.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: redis -Version: 3.3.6 +Version: 3.3.8 Summary: Python client for Redis key-value store Home-page: https://github.com/andymccurdy/redis-py Author: Andy McCurdy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.6/redis/__init__.py new/redis-3.3.8/redis/__init__.py --- old/redis-3.3.6/redis/__init__.py 2019-08-06 19:59:24.000000000 +0200 +++ new/redis-3.3.8/redis/__init__.py 2019-08-19 21:31:23.000000000 +0200 @@ -29,7 +29,7 @@ return value -__version__ = '3.3.6' +__version__ = '3.3.8' VERSION = tuple(map(int_or_str, __version__.split('.'))) __all__ = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.6/redis/client.py new/redis-3.3.8/redis/client.py --- old/redis-3.3.6/redis/client.py 2019-07-28 22:34:56.000000000 +0200 +++ new/redis-3.3.8/redis/client.py 2019-08-19 21:31:23.000000000 +0200 @@ -3002,7 +3002,7 @@ next_command() method returns one command from monitor listen() method yields commands from monitor. """ - monitor_re = re.compile(r'\[(\d+) (.+):(\d+)\] (.*)') + monitor_re = re.compile(r'\[(\d+) (.*)\] (.*)') command_re = re.compile(r'"(.*?)(?<!\\)"') def __init__(self, connection_pool): @@ -3028,14 +3028,28 @@ response = self.connection.encoder.decode(response, force=True) command_time, command_data = response.split(' ', 1) m = self.monitor_re.match(command_data) - db_id, client_address, client_port, command = m.groups() + db_id, client_info, command = m.groups() command = ' '.join(self.command_re.findall(command)) command = command.replace('\\"', '"').replace('\\\\', '\\') + + if client_info == 'lua': + client_address = 'lua' + client_port = '' + client_type = 'lua' + elif client_info.startswith('unix'): + client_address = 'unix' + client_port = client_info[5:] + client_type = 'unix' + else: + # use rsplit as ipv6 addresses contain colons + client_address, client_port = client_info.rsplit(':', 1) + client_type = 'tcp' return { 'time': float(command_time), 'db': int(db_id), 'client_address': client_address, 'client_port': client_port, + 'client_type': client_type, 'command': command } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.6/redis/connection.py new/redis-3.3.8/redis/connection.py --- old/redis-3.3.6/redis/connection.py 2019-08-06 19:54:07.000000000 +0200 +++ new/redis-3.3.8/redis/connection.py 2019-08-19 21:17:14.000000000 +0200 @@ -46,6 +46,16 @@ else: NONBLOCKING_EXCEPTION_ERROR_NUMBERS[ssl.SSLError] = 2 +# In Python 2.7 a socket.error is raised for a nonblocking read. +# The _compat module aliases BlockingIOError to socket.error to be +# Python 2/3 compatible. +# However this means that all socket.error exceptions need to be handled +# properly within these exception handlers. +# We need to make sure socket.error is included in these handlers and +# provide a dummy error number that will never match a real exception. +if socket.error not in NONBLOCKING_EXCEPTION_ERROR_NUMBERS: + NONBLOCKING_EXCEPTION_ERROR_NUMBERS[socket.error] = -999999 + NONBLOCKING_EXCEPTIONS = tuple(NONBLOCKING_EXCEPTION_ERROR_NUMBERS.keys()) if HIREDIS_AVAILABLE: @@ -184,7 +194,7 @@ return True except socket.timeout: if raise_on_timeout: - raise + raise TimeoutError("Timeout reading from socket") return False except NONBLOCKING_EXCEPTIONS as ex: # if we're in nonblocking mode and the recv raises a @@ -194,7 +204,8 @@ allowed = NONBLOCKING_EXCEPTION_ERROR_NUMBERS.get(ex.__class__, -1) if not raise_on_timeout and ex.errno == allowed: return False - raise + raise ConnectionError("Error while reading from socket: %s" % + (ex.args,)) finally: if custom_timeout: sock.settimeout(self.socket_timeout) @@ -414,7 +425,7 @@ return True except socket.timeout: if raise_on_timeout: - raise + raise TimeoutError("Timeout reading from socket") return False except NONBLOCKING_EXCEPTIONS as ex: # if we're in nonblocking mode and the recv raises a @@ -424,7 +435,8 @@ allowed = NONBLOCKING_EXCEPTION_ERROR_NUMBERS.get(ex.__class__, -1) if not raise_on_timeout and ex.errno == allowed: return False - raise + raise ConnectionError("Error while reading from socket: %s" % + (ex.args,)) finally: if custom_timeout: sock.settimeout(self._socket_timeout) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.6/redis.egg-info/PKG-INFO new/redis-3.3.8/redis.egg-info/PKG-INFO --- old/redis-3.3.6/redis.egg-info/PKG-INFO 2019-08-06 20:10:20.000000000 +0200 +++ new/redis-3.3.8/redis.egg-info/PKG-INFO 2019-08-19 21:39:44.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: redis -Version: 3.3.6 +Version: 3.3.8 Summary: Python client for Redis key-value store Home-page: https://github.com/andymccurdy/redis-py Author: Andy McCurdy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-3.3.6/tests/test_monitor.py new/redis-3.3.8/tests/test_monitor.py --- old/redis-3.3.6/tests/test_monitor.py 2019-07-10 01:20:34.000000000 +0200 +++ new/redis-3.3.8/tests/test_monitor.py 2019-08-19 21:31:23.000000000 +0200 @@ -29,6 +29,7 @@ response = wait_for_command(r, m, 'PING') assert isinstance(response['time'], float) assert response['db'] == 9 + assert response['client_type'] in ('tcp', 'unix') assert isinstance(response['client_address'], unicode) assert isinstance(response['client_port'], unicode) assert response['command'] == 'PING' @@ -45,3 +46,13 @@ r.get(byte_string) response = wait_for_command(r, m, 'GET foo\\x92') assert response['command'] == 'GET foo\\x92' + + def test_lua_script(self, r): + with r.monitor() as m: + script = 'return redis.call("GET", "foo")' + assert r.eval(script, 0) is None + response = wait_for_command(r, m, 'GET foo') + assert response['command'] == 'GET foo' + assert response['client_type'] == 'lua' + assert response['client_address'] == 'lua' + assert response['client_port'] == ''