Hello community, here is the log from the commit of package python-redis for openSUSE:Factory checked in at 2013-11-25 16:03:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-redis (Old) and /work/SRC/openSUSE:Factory/.python-redis.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-redis" Changes: -------- --- /work/SRC/openSUSE:Factory/python-redis/python-redis.changes 2013-08-07 20:53:12.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-redis.new/python-redis.changes 2013-11-25 16:03:32.000000000 +0100 @@ -1,0 +2,13 @@ +Sun Nov 24 19:04:47 UTC 2013 - [email protected] + +- Update to version 2.8 + + redis-py should play better with gevent when a gevent Timeout is raised. + + Added SENTINEL command + + Fixed a bug where pipelines could potentially correct a connection + if the MULTI command generated a ResponseError. + + Connections now call socket.shutdown() prior to socket.close() to + ensure communication ends immediately per the note at + http://docs.python.org/2/library/socket.html#socket.socket.close + + Lock checks are now based on floats rather than ints. + +------------------------------------------------------------------- Old: ---- redis-2.7.6.tar.gz New: ---- redis-2.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-redis.spec ++++++ --- /var/tmp/diff_new_pack.hfMqNz/_old 2013-11-25 16:03:33.000000000 +0100 +++ /var/tmp/diff_new_pack.hfMqNz/_new 2013-11-25 16:03:33.000000000 +0100 @@ -17,7 +17,7 @@ Name: python-redis -Version: 2.7.6 +Version: 2.8.0 Release: 0 Url: http://github.com/andymccurdy/redis-py Summary: Python client for Redis key-value store ++++++ redis-2.7.6.tar.gz -> redis-2.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-2.7.6/CHANGES new/redis-2.8.0/CHANGES --- old/redis-2.7.6/CHANGES 2013-06-14 18:50:11.000000000 +0200 +++ new/redis-2.8.0/CHANGES 2013-08-24 00:38:08.000000000 +0200 @@ -1,3 +1,16 @@ +* 2.8.0 + * redis-py should play better with gevent when a gevent Timeout is raised. + Thanks leifkb. + * Added SENTINEL command. Thanks Anna Janackova. + * Fixed a bug where pipelines could potentially correct a connection + if the MULTI command generated a ResponseError. Thanks EliFinkelshteyn + for the report. + * Connections now call socket.shutdown() prior to socket.close() to + ensure communication ends immediately per the note at + http://docs.python.org/2/library/socket.html#socket.socket.close + Thanks to David Martin for pointing this out. + * Lock checks are now based on floats rather than ints. Thanks + Vitja Makarov. * 2.7.6 * Added CONFIG RESETSTAT command. Thanks Yossi Gottlieb. * Fixed a bug introduced in 2.7.3 that caused issues with script objects diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-2.7.6/PKG-INFO new/redis-2.8.0/PKG-INFO --- old/redis-2.7.6/PKG-INFO 2013-06-14 18:55:36.000000000 +0200 +++ new/redis-2.8.0/PKG-INFO 2013-08-24 00:39:42.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: redis -Version: 2.7.6 +Version: 2.8.0 Summary: Python client for Redis key-value store Home-page: http://github.com/andymccurdy/redis-py Author: Andy McCurdy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-2.7.6/redis/__init__.py new/redis-2.8.0/redis/__init__.py --- old/redis-2.7.6/redis/__init__.py 2013-06-14 18:52:43.000000000 +0200 +++ new/redis-2.8.0/redis/__init__.py 2013-08-24 00:38:41.000000000 +0200 @@ -19,7 +19,7 @@ ) -__version__ = '2.7.6' +__version__ = '2.8.0' VERSION = tuple(map(int, __version__.split('.'))) __all__ = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-2.7.6/redis/client.py new/redis-2.8.0/redis/client.py --- old/redis-2.7.6/redis/client.py 2013-06-13 03:26:53.000000000 +0200 +++ new/redis-2.8.0/redis/client.py 2013-08-23 20:40:28.000000000 +0200 @@ -104,11 +104,26 @@ for line in response.splitlines(): if line and not line.startswith('#'): - key, value = line.split(':') + key, value = line.split(':', 1) info[key] = get_value(value) return info +def parse_sentinel(response, **options): + "Parse the result of Redis's SENTINEL command" + output = [] + parse = options['parse'] + + if parse == 'SENTINEL_INFO': + for sub_list in response: + it = iter(sub_list) + output.append(dict(izip(it, it))) + else: + output = response + + return output + + def pairs_to_dict(response): "Create a dict given a list of key/value pairs" it = iter(response) @@ -244,7 +259,8 @@ 'RANDOMKEY': lambda r: r and r or None, 'SCRIPT': parse_script, 'SET': lambda r: r and nativestr(r) == 'OK', - 'TIME': lambda x: (int(x[0]), int(x[1])) + 'TIME': lambda x: (int(x[0]), int(x[1])), + 'SENTINEL': parse_sentinel } ) @@ -487,6 +503,14 @@ """ return self.execute_command('SAVE') + def sentinel(self, *args): + "Redis Sentinel's SENTINEL command" + if args[0] in ['masters', 'slaves', 'sentinels']: + parse = 'SENTINEL_INFO' + else: + parse = 'SENTINEL' + return self.execute_command('SENTINEL', *args, **{'parse': parse}) + def shutdown(self): "Shutdown the server" try: @@ -555,6 +579,13 @@ return self.execute_command('DEL', *names) __delitem__ = delete + def dump(self, name): + """ + Return a serialized version of the value stored at the specified key. + If key does not exist a nil bulk reply is returned. + """ + return self.execute_command('DUMP', name) + def exists(self, name): "Returns a boolean indicating whether key ``name`` exists" return self.execute_command('EXISTS', name) @@ -736,6 +767,13 @@ "Rename key ``src`` to ``dst`` if ``dst`` doesn't already exist" return self.execute_command('RENAMENX', src, dst) + def restore(self, name, ttl, value): + """ + Create a key using the provided serialized value, previously obtained + using DUMP. + """ + return self.execute_command('RESTORE', name, ttl, value) + def set(self, name, value, ex=None, px=None, nx=False, xx=False): """ Set the value at key ``name`` to ``value`` @@ -1155,6 +1193,10 @@ return self.execute_command('ZCARD', name) def zcount(self, name, min, max): + """ + Returns the number of elements in the sorted set at key ``name`` with + a score between ``min`` and ``max``. + """ return self.execute_command('ZCOUNT', name, min, max) def zincrby(self, name, value, amount=1): @@ -1825,10 +1867,18 @@ starmap(connection.pack_command, [args for args, options in cmds])) connection.send_packed_command(all_cmds) + errors = [] + # parse off the response for MULTI - self.parse_response(connection, '_') + # NOTE: we need to handle ResponseErrors here and continue + # so that we read all the additional command messages from + # the socket + try: + self.parse_response(connection, '_') + except ResponseError: + errors.append((0, sys.exc_info()[1])) + # and all the other commands - errors = [] for i, _ in enumerate(commands): try: self.parse_response(connection, '_') @@ -2059,7 +2109,7 @@ sleep = self.sleep timeout = self.timeout while 1: - unixtime = int(mod_time.time()) + unixtime = mod_time.time() if timeout: timeout_at = unixtime + timeout else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-2.7.6/redis/connection.py new/redis-2.8.0/redis/connection.py --- old/redis-2.7.6/redis/connection.py 2013-06-14 18:44:30.000000000 +0200 +++ new/redis-2.8.0/redis/connection.py 2013-08-23 20:36:38.000000000 +0200 @@ -3,6 +3,7 @@ import socket import sys + from redis._compat import (b, xrange, imap, byte_to_chr, unicode, bytes, long, BytesIO, nativestr, basestring, LifoQueue, Empty, Full) @@ -275,6 +276,7 @@ if self._sock is None: return try: + self._sock.shutdown(socket.SHUT_RDWR) self._sock.close() except socket.error: pass @@ -295,7 +297,7 @@ _errno, errmsg = e.args raise ConnectionError("Error %s while writing to socket. %s." % (_errno, errmsg)) - except Exception: + except: self.disconnect() raise @@ -307,7 +309,7 @@ "Read the response from a previously sent command" try: response = self._parser.read_response() - except Exception: + except: self.disconnect() raise if isinstance(response, ResponseError): @@ -328,14 +330,17 @@ def pack_command(self, *args): "Pack a series of arguments into a value Redis command" - output = SYM_STAR + b(str(len(args))) + SYM_CRLF + output = BytesIO() + output.write(SYM_STAR) + output.write(b(str(len(args)))) + output.write(SYM_CRLF) for enc_value in imap(self.encode, args): - output += SYM_DOLLAR - output += b(str(len(enc_value))) - output += SYM_CRLF - output += enc_value - output += SYM_CRLF - return output + output.write(SYM_DOLLAR) + output.write(b(str(len(enc_value)))) + output.write(SYM_CRLF) + output.write(enc_value) + output.write(SYM_CRLF) + return output.getvalue() class UnixDomainSocketConnection(Connection): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-2.7.6/redis.egg-info/PKG-INFO new/redis-2.8.0/redis.egg-info/PKG-INFO --- old/redis-2.7.6/redis.egg-info/PKG-INFO 2013-06-14 18:55:36.000000000 +0200 +++ new/redis-2.8.0/redis.egg-info/PKG-INFO 2013-08-24 00:39:42.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: redis -Version: 2.7.6 +Version: 2.8.0 Summary: Python client for Redis key-value store Home-page: http://github.com/andymccurdy/redis-py Author: Andy McCurdy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-2.7.6/redis.egg-info/SOURCES.txt new/redis-2.8.0/redis.egg-info/SOURCES.txt --- old/redis-2.7.6/redis.egg-info/SOURCES.txt 2013-06-14 18:55:36.000000000 +0200 +++ new/redis-2.8.0/redis.egg-info/SOURCES.txt 2013-08-24 00:39:42.000000000 +0200 @@ -29,4 +29,32 @@ tests/test_pipeline.py tests/test_pipeline.pyc tests/test_pubsub.py -tests/test_pubsub.pyc \ No newline at end of file +tests/test_pubsub.pyc +tests/__pycache__/__init__.cpython-32.pyc +tests/__pycache__/__init__.cpython-33.pyc +tests/__pycache__/conftest.cpython-32.pyc +tests/__pycache__/conftest.cpython-33.pyc +tests/__pycache__/test_commands.cpython-26-PYTEST.pyc +tests/__pycache__/test_commands.cpython-27-PYTEST.pyc +tests/__pycache__/test_commands.cpython-32-PYTEST.pyc +tests/__pycache__/test_commands.cpython-33-PYTEST.pyc +tests/__pycache__/test_connection_pool.cpython-26-PYTEST.pyc +tests/__pycache__/test_connection_pool.cpython-27-PYTEST.pyc +tests/__pycache__/test_connection_pool.cpython-32-PYTEST.pyc +tests/__pycache__/test_connection_pool.cpython-33-PYTEST.pyc +tests/__pycache__/test_encoding.cpython-26-PYTEST.pyc +tests/__pycache__/test_encoding.cpython-27-PYTEST.pyc +tests/__pycache__/test_encoding.cpython-32-PYTEST.pyc +tests/__pycache__/test_encoding.cpython-33-PYTEST.pyc +tests/__pycache__/test_lock.cpython-26-PYTEST.pyc +tests/__pycache__/test_lock.cpython-27-PYTEST.pyc +tests/__pycache__/test_lock.cpython-32-PYTEST.pyc +tests/__pycache__/test_lock.cpython-33-PYTEST.pyc +tests/__pycache__/test_pipeline.cpython-26-PYTEST.pyc +tests/__pycache__/test_pipeline.cpython-27-PYTEST.pyc +tests/__pycache__/test_pipeline.cpython-32-PYTEST.pyc +tests/__pycache__/test_pipeline.cpython-33-PYTEST.pyc +tests/__pycache__/test_pubsub.cpython-26-PYTEST.pyc +tests/__pycache__/test_pubsub.cpython-27-PYTEST.pyc +tests/__pycache__/test_pubsub.cpython-32-PYTEST.pyc +tests/__pycache__/test_pubsub.cpython-33-PYTEST.pyc \ No newline at end of file Files old/redis-2.7.6/tests/__init__.pyc and new/redis-2.8.0/tests/__init__.pyc differ Files old/redis-2.7.6/tests/__pycache__/__init__.cpython-32.pyc and new/redis-2.8.0/tests/__pycache__/__init__.cpython-32.pyc differ Files old/redis-2.7.6/tests/__pycache__/__init__.cpython-33.pyc and new/redis-2.8.0/tests/__pycache__/__init__.cpython-33.pyc differ Files old/redis-2.7.6/tests/__pycache__/conftest.cpython-32.pyc and new/redis-2.8.0/tests/__pycache__/conftest.cpython-32.pyc differ Files old/redis-2.7.6/tests/__pycache__/conftest.cpython-33.pyc and new/redis-2.8.0/tests/__pycache__/conftest.cpython-33.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_commands.cpython-26-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_commands.cpython-26-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_commands.cpython-27-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_commands.cpython-27-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_commands.cpython-32-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_commands.cpython-32-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_commands.cpython-33-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_commands.cpython-33-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_connection_pool.cpython-26-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_connection_pool.cpython-26-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_connection_pool.cpython-27-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_connection_pool.cpython-27-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_connection_pool.cpython-32-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_connection_pool.cpython-32-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_connection_pool.cpython-33-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_connection_pool.cpython-33-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_encoding.cpython-26-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_encoding.cpython-26-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_encoding.cpython-27-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_encoding.cpython-27-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_encoding.cpython-32-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_encoding.cpython-32-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_encoding.cpython-33-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_encoding.cpython-33-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_lock.cpython-26-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_lock.cpython-26-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_lock.cpython-27-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_lock.cpython-27-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_lock.cpython-32-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_lock.cpython-32-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_lock.cpython-33-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_lock.cpython-33-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_pipeline.cpython-26-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_pipeline.cpython-26-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_pipeline.cpython-27-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_pipeline.cpython-27-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_pipeline.cpython-32-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_pipeline.cpython-32-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_pipeline.cpython-33-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_pipeline.cpython-33-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_pubsub.cpython-26-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_pubsub.cpython-26-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_pubsub.cpython-27-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_pubsub.cpython-27-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_pubsub.cpython-32-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_pubsub.cpython-32-PYTEST.pyc differ Files old/redis-2.7.6/tests/__pycache__/test_pubsub.cpython-33-PYTEST.pyc and new/redis-2.8.0/tests/__pycache__/test_pubsub.cpython-33-PYTEST.pyc differ Files old/redis-2.7.6/tests/conftest.pyc and new/redis-2.8.0/tests/conftest.pyc differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/redis-2.7.6/tests/test_commands.py new/redis-2.8.0/tests/test_commands.py --- old/redis-2.7.6/tests/test_commands.py 2013-06-13 03:26:53.000000000 +0200 +++ new/redis-2.8.0/tests/test_commands.py 2013-08-23 20:36:35.000000000 +0200 @@ -205,6 +205,14 @@ del r['a'] assert r.get('a') is None + @skip_if_server_version_lt('2.6.0') + def test_dump_and_restore(self, r): + r['a'] = 'foo' + dumped = r.dump('a') + del r['a'] + r.restore('a', 0, dumped) + assert r['a'] == b('foo') + def test_exists(self, r): assert not r.exists('a') r['a'] = 'foo' Files old/redis-2.7.6/tests/test_commands.pyc and new/redis-2.8.0/tests/test_commands.pyc differ Files old/redis-2.7.6/tests/test_connection_pool.pyc and new/redis-2.8.0/tests/test_connection_pool.pyc differ Files old/redis-2.7.6/tests/test_encoding.pyc and new/redis-2.8.0/tests/test_encoding.pyc differ Files old/redis-2.7.6/tests/test_lock.pyc and new/redis-2.8.0/tests/test_lock.pyc differ Files old/redis-2.7.6/tests/test_pipeline.pyc and new/redis-2.8.0/tests/test_pipeline.pyc differ Files old/redis-2.7.6/tests/test_pubsub.pyc and new/redis-2.8.0/tests/test_pubsub.pyc differ -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
