Hello community,
here is the log from the commit of package python-python-memcached for
openSUSE:Factory checked in at 2013-06-14 15:47:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-memcached (Old)
and /work/SRC/openSUSE:Factory/.python-python-memcached.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-memcached"
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-python-memcached/python-python-memcached.changes
2013-04-26 15:53:12.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.python-python-memcached.new/python-python-memcached.changes
2013-06-14 15:47:22.000000000 +0200
@@ -1,0 +2,21 @@
+Mon May 27 10:30:36 UTC 2013 - [email protected]
+
+- update to 1.51:
+ * Add a MANIFEST.in file, patch by Daniel Widerin.
+ * Client() now takes a "check_keys" option, which defaults to True.
+ If False, it disables the checking of keys to ensure they have
+ acceptable size and are composed of non-control characters.
+ Suggested by Ben Hoyt.
+ * Converting control character checking of keys based on performance
+ testing of alternatives by Ben Hoyt.
+ * Converted unicode tests from using u'', patch from Eren Güve.
+ * Included license file (pull request by "Philippe" pombredanne).
+ * Doing a "set" after server goes away, raised AttributeError:
+ 'NoneType' object has no attribute 'sendall'. Patch by Ken Lalonde
+ * incr/decr return None instead of 0 on server connection failure.
+ Suggested by Ivan Virabyan
+ * Supports IPv6 connections using: "inet6:[fd00::32:19f7]:11000".
+ Patch by Romain Courteaud
+- python-memcached-ipv6-and-or.patch: remove. Solved differently upstream
+
+-------------------------------------------------------------------
Old:
----
python-memcached-1.48.tar.gz
python-memcached-ipv6-and-or.patch
New:
----
python-memcached-1.51.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-memcached.spec ++++++
--- /var/tmp/diff_new_pack.QrQB68/_old 2013-06-14 15:47:22.000000000 +0200
+++ /var/tmp/diff_new_pack.QrQB68/_new 2013-06-14 15:47:22.000000000 +0200
@@ -17,24 +17,23 @@
Name: python-python-memcached
-Version: 1.48
+Version: 1.51
Release: 0
Url: http://www.tummy.com/Community/software/python-memcached/
Summary: Pure python memcached client
License: Python-2.0
Group: Development/Languages/Python
Source:
http://pypi.python.org/packages/source/p/python-memcached/python-memcached-%{version}.tar.gz
-Patch0: python-memcached-ipv6-and-or.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-distribute
-Provides: python-memcached = %{version}
-Obsoletes: python-memcached < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from
distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
+Provides: python-memcached = %{version}
+Obsoletes: python-memcached < %{version}
%description
This package was originally written by Evan Martin of Danga.
@@ -47,7 +46,6 @@
%prep
%setup -q -n python-memcached-%{version}
-%patch0 -p1
%build
python setup.py build
@@ -57,7 +55,7 @@
%files
%defattr(-,root,root,-)
-%doc README
+%doc README.md
%{python_sitelib}/*
%changelog
++++++ python-memcached-1.48.tar.gz -> python-memcached-1.51.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-memcached-1.48/ChangeLog
new/python-memcached-1.51/ChangeLog
--- old/python-memcached-1.48/ChangeLog 1970-01-01 01:00:00.000000000 +0100
+++ new/python-memcached-1.51/ChangeLog 2013-05-06 23:30:10.000000000 +0200
@@ -0,0 +1,414 @@
+Mon, 06 May 2013 15:29:07 -0600 Sean Reifschneider <[email protected]>
+
+ * 1.51 release.
+
+ * Add a MANIFEST.in file, patch by Daniel Widerin.
+
+Mon, 06 May 2013 07:20:21 -0600 Sean Reifschneider <[email protected]>
+
+ * 1.50 release.
+
+ * Client() now takes a "check_keys" option, which defaults to True.
+ If False, it disables the checking of keys to ensure they have
+ acceptable size and are composed of non-control characters.
+ Suggested by Ben Hoyt.
+
+ * Converting control character checking of keys based on performance
+ testing of alternatives by Ben Hoyt.
+
+ * Converted unicode tests from using u'', patch from Eren Güve.
+
+ * Included license file (pull request by "Philippe" pombredanne).
+
+ * Doing a "set" after server goes away, raised AttributeError:
+ 'NoneType' object has no attribute 'sendall'. Patch by Ken Lalonde
+
+ * incr/decr return None instead of 0 on server connection failure.
+ Suggested by Ivan Virabyan
+
+ * Supports IPv6 connections using: "inet6:[fd00::32:19f7]:11000".
+ Patch by Romain Courteaud
+
+ * Switching over to github for this project:
+
+ https://github.com/linsomniac
+
+ * Bug #974632: _ConnectionDeadError sometimes was escaping the get/set
+ code. This should return to readline() not raising an exception, except
+ in the case that it's called from the get/set(). Report from Gary
+ Poster, proposed patch by Brad Crittenden.
+
+ Misc fixes by Brad Crittenden: fixing a docstring, if "port" is set to
+ any false-like value it will default to 11211.
+
+Mon, 29 Nov 2011 12:37:32 -0700 Sean Reifschneider <[email protected]>
+
+ * Bug #887765: Interrupted connection to memcache server can cause
+ inconsistencies.
+ Added "flush_on_reconnect" (defaults to off) to Client() which will
+ cause a client that has lost connection to a server and then reconnects
+ to flush the cache on the reconnect so that it doesn't get old values
+ from that server. Patch by Daniel Benamy.
+
+Sun, 27 Nov 2011 18:15:32 -0700 Sean Reifschneider <[email protected]>
+
+ * Bug #745633: Values of maximum size are not stored
+ API inconsistency, max value length was tested for <= while max KEY
+ length was <. So I picked that keys and values *LONGER* than the
+ specified max value are what is used, and added documentation and tests
+ to that effect. The test for max value tested that length plus 4, so
+ I've changed that to be that value plus 1. Issue found by matt-quru.
+
+ * Bug #713488: Issues Invalid "delete" command.
+ Protocol has changed so that the "delete" operation no longer takes a
+ "time" argument. It seems that some servers will refuse a "delete key
+ 0" while others will accept it, but the official server will NOT accept
+ "delete key 1". So I've changed it so that if no "time" argument is
+ specified, no time argument is sent to the server.
+
+ * Bug #713451: server.expect("END") needs to be in a finally block
+ Expect an "END" when the _recv_value() raises an exception.
+ Patch by Jay Farrimond.
+
+ * Bug: #741090: cas cache can grow unbounded. Default now is that the
+ cache is not used, unless the "Client()" object is created with
+ "cache_cas=True". In that case, you need to have your own cas clearing
+ code, a simple one would be to use Client().reset_cas() to completely
+ clear the cas_ids cache. Problem pointed out by Shaun Cutts.
+
+ * Bug #728359: Make python-memcache work on memcache restarts.
+ Patch by Tarek Ziade', reviewed and further patches submitted by Hugo
+ Beauze'e-Luysse and Neganov Alexandr.
+
+ * Bug #798342: If memcached server sends unknown flag in response for
+ "get", results in:
+ "UnboundLocalError: local variable 'val' referenced before assignment"
+ Now returns "None" instead. Patch by Sharoon Thomas
+
+Mon, 20 Dec 2010 19:14:17 -0700 Sean Reifschneider <[email protected]>
+
+ * Bug #680359: useOldServerHashFunction() is broken. It now correctly
+ switches back to the old memcache hash function.
+
+Thu, 16 Dec 2010 02:07:40 -0700 Sean Reifschneider <[email protected]>
+
+ * Bug #471727: Changed the delete() code to explicitly check for both
+ NOT_FOUND and DELETED as the responses and return successful for both.
+ It also logs an error if one of these two responses is not found.
+ Also added a test to ensure that delete() works.
+
+ * When using set_multi and one value is too big, traceback
+ TypeError: 'int' object is unsubscriptable
+ Patch by Orjan Persson
+
+ * Fixing Bug #529855: Server host can now be bare host without ":<port>".
+ Fix proposed by Roger Binns.
+
+ * Fixing Bug #491164: Typo fix, "compession" -> "compRession".
+
+ * Fixing Bug #509712: "TypeError: 'NoneType' object is unsubscriptable"
+ Also fixed some other similar code to not have issues with that.
+
+ * Also related to 509712 and 628339: readline() now returns '' instead
+ of None when a server dies. This should be safer. Patch suggested by
+ Denis Otkidach.
+
+ * Fixing Bug #628339: Read from server sometimes fails. Patch by Jeremy
+ Cowles.
+
+ * Fixing Bug #633553: Add stat arguments support to get_stats(). Patch
+ by Ryan Lane.
+
+ * Changing the license to the PSF License.
+
+ * Removing Evan's e-mail address at his request, changing authorship to
+ Sean.
+
+Sat, 28 Nov 2009 01:07:42 -0700 Sean Reifschneider <[email protected]>
+
+ * Version 1.45
+
+ * Per-connection max server key length. Patch by Nicolas Delaby
+
+ * Patches to make memcached more garbage-collectable. Removes
+ "debugfunc" argument from _Host objects and changed to "debug"
+ boolean. Patches by John McFarlane and Aryeh Katz.
+
+ * Switching to a cmemcache compatible hash function. Implemented by
+ André Cru and Ludvig Ericson. To switch back to the old style, use:
+
+ memcached.useOldServerHashFunction()
+
+ * Rejecting keys that have spaces in them. Patch by Etienne Posthumus.
+
+ * Fixing exception raising syntax. Patch by Samuel Stauffer.
+
+ * Optimizations in read code. Patch by Samuel Stauffer.
+
+ * Changing classes to be newstyle. Patch by Samuel Stauffer.
+
+ * Changed "has_key" to "in". Patch by Samuel Stauffer.
+
+ * incr/decr were raising ValueError if the key did not exist, the
+ docstring said it returned none. Patch by Chihiro Sakatoku.
+
+ * Adding cas method, submitted by Ben Gutierrez.
+
+ * Fix in the docstring for how to use the "set" method. Found and fixed
+ by William McVey
+
+Thu, 02 Apr 2009 13:37:49 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.44
+
+ * Allowing spaces in the key. (Patch provided by xmm on Launchpad)
+
+ * Detecting when the pickler needs a positional argument. (Patch
+ provided by Brad Clements on Launchpad)
+
+ * Moving length check after the compression. (Patch provided by user
+ Tom on Launchpad)
+
+ * Fixing arguments passed to the _Error if invalid read length.
+
+ * Fixing the representation of domain sockets. (Patch provided by user
+ MTB on Launchpad)
+
+ * Changing a typo of dead_until. (Patch provided by Shane R. Spencer)
+
+ * Providing better error messages (patch provided by Johan Euphrosine).
+
+ * Adding get_slabs() function to get stats. (Patch provided
+ by Nick Verbeck)
+
+Sun, 01 Jun 2008 15:05:11 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.43
+
+ * eliott reported a bug in the 1.42 related to the socket timeout code
+ causing a traceback due to the timeout value not being set.
+
+Sat, 31 May 2008 02:09:17 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.42
+
+ * Paul Hummer set up a Launchpad project which I'm going to start using
+ to track patches and allow users to set up their own bzr branches and
+ manage marging in the upstream patches with their own.
+
+ https://launchpad.net/python-memcached
+
+ * Patch from Jehiah Czebotar which does: Changing the calls to
+ mark_dead() to make them dereference tuples, reducing timeout on
+ sockets to 3 seconds, settable via setting Host._SOCKET_TIMEOUT.
+
+ * Patches from Steve Schwarz for set_multi() to return the full set of
+ keys if all servers are down. Previously would not report any keys.
+
+ * Fix from Steve Schwarz delete_multi() argument "seconds" not being
+ correctly handled. Changed it to "time" to match all other calls.
+
+ * Patch from Peter Wilkinson to support using unix domain sockets.
+ He reports that tests succeed with with memcached daemons running,
+ the normal and a domain socket started via
+ "memcached -s memcached.socket". I massaged it quite a bit.
+
+ To use domain sockets, use a connect string of "unix:/path/to/socket"
+ Note however that if you are using a host name of "unix", it will now
+ detect "unix:11211" as being a domain socket with the name "11211".
+ In this case, please use "inet:unix:11211".
+
+ Because of this, it is now preferred to use a connect string prefix
+ of "inet:" or "unix:".
+
+Tue, 29 Apr 2008 21:03:53 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.41
+
+ * Patch from Jehiah Czebotar to catch an additional server disconnect
+ situation.
+
+ * Patch from Andrey Petrov to add the "append" and "replace" commands.
+
+Tue, 18 Sep 2007 20:52:09 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.40
+
+ * Updated setup.py file that uses distutils provided by Kai Lautaportti.
+
+ * Prevent keys from containing ASCII character 127 as well, patch provided
+ by Philip Neustrom.
+
+ * Added ability to overload the persistent_load/id, patch provided by
+ Steve Schwarz.
+
+ * Fixed ability to pass (server_hash,key) in place of key in Client.set()
+ Reported by Alexander Klyuev.
+
+Tue, 14 Aug 2007 14:43:27 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.39
+
+ * Michael Krause reports the previous version doesn't work for
+ _val_to_store_info() calls because it's defined as a staticmethod.
+ Removing staticmethod decorator. Also confirmed by Kai Lautaportti,
+ with suggested fix of removing staticmethod.
+
+Fri, 10 Aug 2007 17:50:13 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.38
+
+ * Matt McClanahan submitted a patch that allow add() to have a
+ min_compress_len argument.
+
+ * Steve Schwarz submitted a patch allowing user-defined picklers.
+
+ * Michael Krause suggested checking the return value to prevent an
+ exception from being raised in _set() when a value is too large to be
+ stored.
+
+Fri, 27 Jul 2007 01:55:48 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.37
+
+ * Fixing call from add() to _set() with parameter for min_compress_len.
+ Reported by Jeff Fisher.
+
+Thu, 07 Jun 2007 04:10:31 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.36
+
+ * Patch by Dave St.Germain to make the Client() class sub-class
+ threadlocal to help with multi-threading issues. Only available in
+ Python 2.4 and above.
+
+ * Patch by James Robinson with:
+ 1) new set_multi method.
+ 2) factored out determining the flags, length, and value to store
+ from set() into method _val_to_store_info() for use by both set()
+ and set_multi().
+ 3) send_cmds() method on host which doesn't apply the trailing '\r\n'
+ for use by set_multi.
+ 4) check_key() extended a bit to allow for testing the prefix passed
+ to set_multi just once, not once per each key.
+ 5) Patch also enables support for auto compression in set, set_multi,
+ and replace.
+
+ * Suggestion by Helge Tesdal, fixes in check_key for non-string keys.
+
+ * NOTE: On a farm of clients with multiple servers, all clients will
+ need to be upgraded to this version. The next patch changes the
+ server hash.
+
+ * Philip Neustrom supplied a patch to change the server hash function to
+ binascii.crc32. The original "hash()" call is not cross-platform, so
+ big and little endian systems accessing the same memcache may end up
+ hitting different servers. Restore the old functionality by calling:
+ "memcached.serverHashFunction = hash" after importing memcache.
+
+ * Philip Neustrom points out that passing Unicode keys or values causes
+ problems because len(key) or len(value) is not equal to the number of
+ bytes that are required to store the key/value. Philip provides a
+ patch which raises an exception in this case. Raises
+ memcache.Client.MemcachedStringEncodingError exception in this case.
+
+ * NOTE: If you recompiled memcached to increase the default 1MB max
+ value size, you will need to call "memcached.MAX_SERVER_VALUE_LENGTH = N"
+ or memcached will not store values larger than the default 1MB.
+
+ * Philip Neustrom includes another patch which checks that the key
+ doesn't exceed the memcache server's max size. If it does, the item
+ is silently not stored.
+
+ * Philip Neustrom added a bunch of sanity checks.
+
+ * Jehiah Czebotar provided a patch to make the add() and replace()
+ functions return 0 when the add or replace fails, similar to how set()
+ works.
+
+Sat, 16 Sep 2006 18:31:46 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.34
+
+ * In get_multi, if the recv loop reads 0 bytes, raising an EOFError.
+ Identified by Jim Baker.
+
+Tue, 05 Sep 2006 14:06:50 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.33
+
+ * Including patch from Yoshinori K. Okuji to read in larger chunks for
+ readline() calls. This should dramatically improve performance under
+ some circumstances.
+
+Sun, 03 Sep 2006 14:02:03 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.32
+
+ * Including patch from Philip Neustrom which checks keys sent to the
+ server for length and bad characters.
+
+Sat, 20 May 2006 14:51:28 -0600 Sean Reifschneider <[email protected]>
+
+ * Version 1.31
+
+ * Rolled version 1.30 since the Danga folks are now listing this
+ version as the official version. Removing the "tummy" from the version
+ number, and incrementing so that it's clear it's more recent than "1.2".
+
+ * Patch applied from Simon Forman for handling of weighted hosts.
+
+ * Added a little more meat to the README.
+
+Sat, 28 Jan 2006 15:59:50 -0700 Sean Reifschneider <[email protected]>
+
+ * cludwin at socallocal suggested that the write-combining with
+ sendall() may not be beneficial. After testing on both SMP and non-SMP
+ machines, I can't see a significant benefit to not doing the
+ write-combining, even on large strings. The benefits of write-combining
+ on smaller strings seems to be significant on UP machines in tight loops.
+ Even on strings that are larger than 2MB, there seems to be no benefit to
+ splitting out the writes.
+
+Sun, 18 Sep 2005 18:56:31 -0600 Sean Reifschneider <[email protected]>
+
+ * Changing a printf to debuglog and catching a pickle exception, patch
+ submitted by Justin Azoff.
+
+Thu, 14 Jul 2005 11:17:30 -0700 Sean Reifschneider <[email protected]>
+
+ * Alex Stapleton found that the sendall call was slow for writing data
+ larger than several kilobytes. I had him test a change to his patch,
+ which worked as well, but was simpler. The code now does two sendall
+ calls, one for the data and one for the line termination, if the data is
+ larger than 100 bytes.
+
+Thu, 7 Apr 2005 14:45:44 -0700 Sean Reifschneider <[email protected]>
+
+ * Incorporating some fixes to get_multi() from Bo Yang
+
+Mon, 13 Dec 2004 02:35:17 -0700 Sean Reifschneider <[email protected]>
+
+ * Simplifying the readline() function and speeding it up ~25%.
+ * Fixing a bug in readline() if the server drops, mark_dead() was not
+ being properly called.
+
+Sun, 12 Dec 2004 18:56:33 -0700 Sean Reifschneider <[email protected]>
+
+ * Adding "stats()" and "flush_all()" methods.
+
+Thu, 10 Aug 2003 12:17:50 -0700 Evan Martin <[email protected]>
+
+ * Slightly more verbose self-test output.
+ * Fix mark_dead() to use proper classname.
+ * Make pooltest.py run from the test directory.
+
+Thu, 07 Aug 2003 16:32:32 -0700 Evan Martin <[email protected]>
+
+ * Add incr, decr, and delete.
+ * Better Python (based on comments from Uriah Welcome).
+ * Docs, using epydoc.
+
+Thu, 07 Aug 2003 14:20:27 -0700 Evan Martin <[email protected]>
+
+ * Initial prerelease.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-memcached-1.48/MANIFEST.in
new/python-memcached-1.51/MANIFEST.in
--- old/python-memcached-1.48/MANIFEST.in 1970-01-01 01:00:00.000000000
+0100
+++ new/python-memcached-1.51/MANIFEST.in 2013-05-06 23:30:10.000000000
+0200
@@ -0,0 +1,10 @@
+include *.md
+include *.rst
+include *.txt
+
+include ChangeLog
+include MakeFile
+
+global-exclude *.pyc
+global-exclude .gitignore
+global-exclude .DS_Store
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-memcached-1.48/PKG-INFO
new/python-memcached-1.51/PKG-INFO
--- old/python-memcached-1.48/PKG-INFO 2013-03-29 01:18:46.000000000 +0100
+++ new/python-memcached-1.51/PKG-INFO 2013-05-06 23:30:11.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-memcached
-Version: 1.48
+Version: 1.51
Summary: Pure python memcached client
Home-page: http://www.tummy.com/Community/software/python-memcached/
Author: Sean Reifschneider
@@ -16,6 +16,14 @@
Please do not contact Evan about maintenance.
Sean Reifschneider of tummy.com, ltd. has taken over maintenance of it.
+ Please report issues and submit code changes to the github repository
at:
+
+ https://github.com/linsomniac/python-memcached
+
+ For changes prior to 2013-03-26, see the old Launchpad repository at:
+
+ Historic issues: https://launchpad.net/python-memcached
+
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-memcached-1.48/README
new/python-memcached-1.51/README
--- old/python-memcached-1.48/README 2011-11-28 02:17:32.000000000 +0100
+++ new/python-memcached-1.51/README 1970-01-01 01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-This software is a 100% Python interface to the memcached memory cache
-daemon. It is the client side software which allows storing values in one
-or more, possibly remote, memcached servers. Search google for memcached
-for more information.
-
-This package was originally written by Evan Martin of Danga.
-Please do not contact Evan about maintenance.
-Sean Reifschneider of tummy.com, ltd. has taken over maintenance of it.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-memcached-1.48/README.md
new/python-memcached-1.51/README.md
--- old/python-memcached-1.48/README.md 1970-01-01 01:00:00.000000000 +0100
+++ new/python-memcached-1.51/README.md 2013-05-06 23:30:10.000000000 +0200
@@ -0,0 +1,16 @@
+This software is a 100% Python interface to the memcached memory cache
+daemon. It is the client side software which allows storing values in one
+or more, possibly remote, memcached servers. Search google for memcached
+for more information.
+
+This package was originally written by Evan Martin of Danga.
+Please do not contact Evan about maintenance.
+Sean Reifschneider of tummy.com, ltd. has taken over maintenance of it.
+
+Please report issues and submit code changes to the github repository at:
+
+ https://github.com/linsomniac/python-memcached
+
+For changes prior to 2013-03-26, see the old Launchpad repository at:
+
+ Historic issues: https://launchpad.net/python-memcached
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-memcached-1.48/memcache.py
new/python-memcached-1.51/memcache.py
--- old/python-memcached-1.48/memcache.py 2011-11-28 02:17:32.000000000
+0100
+++ new/python-memcached-1.51/memcache.py 2013-05-06 23:30:11.000000000
+0200
@@ -77,10 +77,12 @@
except ImportError:
from StringIO import StringIO
+invalid_key_characters = ''.join(map(chr, range(33) + [127]))
+
# Original author: Evan Martin of Danga Interactive
__author__ = "Sean Reifschneider <[email protected]>"
-__version__ = "1.48"
+__version__ = "1.51"
__copyright__ = "Copyright (C) 2003 Danga Interactive"
# http://en.wikipedia.org/wiki/Python_Software_Foundation_License
__license__ = "Python Software Foundation License"
@@ -161,7 +163,7 @@
server_max_key_length=SERVER_MAX_KEY_LENGTH,
server_max_value_length=SERVER_MAX_VALUE_LENGTH,
dead_retry=_DEAD_RETRY, socket_timeout=_SOCKET_TIMEOUT,
- cache_cas = False):
+ cache_cas = False, flush_on_reconnect=0, check_keys=True):
"""
Create a new Client object with the given list of servers.
@@ -182,20 +184,31 @@
@param cache_cas: (default False) If true, cas operations will be
cached. WARNING: This cache is not expired internally, if you have
a long-running process you will need to expire it manually via
- "client.reset_cas(), or the cache can grow unlimited.
+ client.reset_cas(), or the cache can grow unlimited.
@param server_max_key_length: (default SERVER_MAX_KEY_LENGTH)
Data that is larger than this will not be sent to the server.
@param server_max_value_length: (default SERVER_MAX_VALUE_LENGTH)
Data that is larger than this will not be sent to the server.
+ @param flush_on_reconnect: optional flag which prevents a scenario that
+ can cause stale data to be read: If there's more than one memcached
+ server and the connection to one is interrupted, keys that mapped to
+ that server will get reassigned to another. If the first server comes
+ back, those keys will map to it again. If it still has its data, get()s
+ can read stale data that was overwritten on another server. This flag
+ is off by default for backwards compatibility.
+ @param check_keys: (default True) If True, the key is checked to
+ ensure it is the correct length and composed of the right characters.
"""
local.__init__(self)
self.debug = debug
self.dead_retry = dead_retry
self.socket_timeout = socket_timeout
+ self.flush_on_reconnect = flush_on_reconnect
self.set_servers(servers)
self.stats = {}
self.cache_cas = cache_cas
self.reset_cas()
+ self.do_check_key = check_keys
# Allow users to modify pickling/unpickling behavior
self.pickleProtocol = pickleProtocol
@@ -235,8 +248,9 @@
an integer weight value.
"""
self.servers = [_Host(s, self.debug, dead_retry=self.dead_retry,
- socket_timeout=self.socket_timeout)
- for s in servers]
+ socket_timeout=self.socket_timeout,
+ flush_on_reconnect=self.flush_on_reconnect)
+ for s in servers]
self._init_buckets()
def get_stats(self, stat_args = None):
@@ -255,6 +269,8 @@
if not s.connect(): continue
if s.family == socket.AF_INET:
name = '%s:%s (%s)' % ( s.ip, s.port, s.weight )
+ elif s.family == socket.AF_INET6:
+ name = '[%s]:%s (%s)' % ( s.ip, s.port, s.weight )
else:
name = 'unix:%s (%s)' % ( s.address, s.weight )
if not stat_args:
@@ -278,6 +294,8 @@
if not s.connect(): continue
if s.family == socket.AF_INET:
name = '%s:%s (%s)' % ( s.ip, s.port, s.weight )
+ elif s.family == socket.AF_INET6:
+ name = '[%s]:%s (%s)' % ( s.ip, s.port, s.weight )
else:
name = 'unix:%s (%s)' % ( s.address, s.weight )
serverData = {}
@@ -297,11 +315,10 @@
return data
def flush_all(self):
- 'Expire all data currently in the memcache servers.'
+ """Expire all data in memcache servers that are reachable."""
for s in self.servers:
if not s.connect(): continue
- s.send_cmd('flush_all')
- s.expect("OK")
+ s.flush()
def debuglog(self, str):
if self.debug:
@@ -418,7 +435,8 @@
should fail. Defaults to None for no delay.
@rtype: int
'''
- self.check_key(key)
+ if self.do_check_key:
+ self.check_key(key)
server, key = self._get_server(key)
if not server:
return 0
@@ -472,16 +490,17 @@
returns 0, not -1.
@param delta: Integer amount to decrement by (should be zero or
greater).
- @return: New value after decrementing.
+ @return: New value after decrementing or None on error.
@rtype: int
"""
return self._incrdecr("decr", key, delta)
def _incrdecr(self, cmd, key, delta):
- self.check_key(key)
+ if self.do_check_key:
+ self.check_key(key)
server, key = self._get_server(key)
if not server:
- return 0
+ return None
self._statlog(cmd)
cmd = "%s %s %d" % (cmd, key, delta)
try:
@@ -603,7 +622,7 @@
"""
# Check it just once ...
key_extra_len=len(key_prefix)
- if key_prefix:
+ if key_prefix and self.do_check_key:
self.check_key(key_prefix)
# server (_Host) -> list of unprefixed server keys in mapping
@@ -622,7 +641,8 @@
server, key = self._get_server(key_prefix + str_orig_key)
# Now check to make sure key length is proper ...
- self.check_key(str_orig_key, key_extra_len=key_extra_len)
+ if self.do_check_key:
+ self.check_key(str_orig_key, key_extra_len=key_extra_len)
if not server:
continue
@@ -769,7 +789,8 @@
return (flags, len(val), val)
def _set(self, cmd, key, val, time, min_compress_len = 0):
- self.check_key(key)
+ if self.do_check_key:
+ self.check_key(key)
server, key = self._get_server(key)
if not server:
return 0
@@ -792,7 +813,8 @@
try:
server.send_cmd(fullcmd)
- return(server.expect("STORED") == "STORED")
+ return(server.expect("STORED", raise_exception=True)
+ == "STORED")
except socket.error, msg:
if isinstance(msg, tuple): msg = msg[1]
server.mark_dead(msg)
@@ -803,14 +825,15 @@
except _ConnectionDeadError:
# retry once
try:
- server._get_socket()
- return _unsafe_set()
+ if server._get_socket():
+ return _unsafe_set()
except (_ConnectionDeadError, socket.error), msg:
server.mark_dead(msg)
return 0
def _get(self, cmd, key):
- self.check_key(key)
+ if self.do_check_key:
+ self.check_key(key)
server, key = self._get_server(key)
if not server:
return None
@@ -823,18 +846,20 @@
rkey = flags = rlen = cas_id = None
if cmd == 'gets':
- rkey, flags, rlen, cas_id, = self._expect_cas_value(server)
+ rkey, flags, rlen, cas_id, = self._expect_cas_value(server,
+ raise_exception=True)
if rkey and self.cache_cas:
self.cas_ids[rkey] = cas_id
else:
- rkey, flags, rlen, = self._expectvalue(server)
+ rkey, flags, rlen, = self._expectvalue(server,
+ raise_exception=True)
if not rkey:
return None
try:
value = self._recv_value(server, flags, rlen)
finally:
- server.expect("END")
+ server.expect("END", raise_exception=True)
except (_Error, socket.error), msg:
if isinstance(msg, tuple): msg = msg[1]
server.mark_dead(msg)
@@ -940,9 +965,9 @@
server.mark_dead(msg)
return retvals
- def _expect_cas_value(self, server, line=None):
+ def _expect_cas_value(self, server, line=None, raise_exception=False):
if not line:
- line = server.readline()
+ line = server.readline(raise_exception)
if line and line[:5] == 'VALUE':
resp, rkey, flags, len, cas_id = line.split()
@@ -950,9 +975,9 @@
else:
return (None, None, None, None)
- def _expectvalue(self, server, line=None):
+ def _expectvalue(self, server, line=None, raise_exception=False):
if not line:
- line = server.readline()
+ line = server.readline(raise_exception)
if line and line[:5] == 'VALUE':
resp, rkey, flags, len = line.split()
@@ -1021,19 +1046,19 @@
len(key) + key_extra_len > self.server_max_key_length:
raise Client.MemcachedKeyLengthError("Key length is > %s"
% self.server_max_key_length)
- for char in key:
- if ord(char) < 33 or ord(char) == 127:
- raise Client.MemcachedKeyCharacterError(
- "Control characters not allowed")
+ if len(key) != len(key.translate(None, invalid_key_characters)):
+ raise Client.MemcachedKeyCharacterError(
+ "Control characters not allowed")
class _Host(object):
def __init__(self, host, debug=0, dead_retry=_DEAD_RETRY,
- socket_timeout=_SOCKET_TIMEOUT):
+ socket_timeout=_SOCKET_TIMEOUT, flush_on_reconnect=0):
self.dead_retry = dead_retry
self.socket_timeout = socket_timeout
self.debug = debug
+ self.flush_on_reconnect = flush_on_reconnect
if isinstance(host, tuple):
host, self.weight = host
else:
@@ -1042,6 +1067,9 @@
# parse the connection string
m = re.match(r'^(?P<proto>unix):(?P<path>.*)$', host)
if not m:
+ m = re.match(r'^(?P<proto>inet6):'
+ r'\[(?P<host>[^\[\]]+)\](:(?P<port>[0-9]+))?$', host)
+ if not m:
m = re.match(r'^(?P<proto>inet):'
r'(?P<host>[^:]+)(:(?P<port>[0-9]+))?$', host)
if not m: m = re.match(r'^(?P<host>[^:]+)(:(?P<port>[0-9]+))?$', host)
@@ -1052,14 +1080,20 @@
if hostData.get('proto') == 'unix':
self.family = socket.AF_UNIX
self.address = hostData['path']
+ elif hostData.get('proto') == 'inet6':
+ self.family = socket.AF_INET6
+ self.ip = hostData['host']
+ self.port = int(hostData.get('port') or 11211)
+ self.address = ( self.ip, self.port )
else:
self.family = socket.AF_INET
self.ip = hostData['host']
- self.port = int(hostData.get('port', 11211))
+ self.port = int(hostData.get('port') or 11211)
self.address = ( self.ip, self.port )
self.deaduntil = 0
self.socket = None
+ self.flush_on_next_connect = 0
self.buffer = ''
@@ -1081,6 +1115,8 @@
def mark_dead(self, reason):
self.debuglog("MemCache: %s: %s. Marking dead." % (self, reason))
self.deaduntil = time.time() + self.dead_retry
+ if self.flush_on_reconnect:
+ self.flush_on_next_connect = 1
self.close_socket()
def _get_socket(self):
@@ -1101,6 +1137,9 @@
return None
self.socket = s
self.buffer = ''
+ if self.flush_on_next_connect:
+ self.flush()
+ self.flush_on_next_connect = 0
return s
def close_socket(self):
@@ -1115,7 +1154,11 @@
""" cmds already has trailing \r\n's applied """
self.socket.sendall(cmds)
- def readline(self):
+ def readline(self, raise_exception=False):
+ """Read a line and return it. If "raise_exception" is set,
+ raise _ConnectionDeadError if the read fails, otherwise return
+ an empty string.
+ """
buf = self.buffer
recv = self.socket.recv
while True:
@@ -1126,14 +1169,17 @@
if not data:
# connection close, let's kill it and raise
self.close_socket()
- raise _ConnectionDeadError()
+ if raise_exception:
+ raise _ConnectionDeadError()
+ else:
+ return ''
buf += data
self.buffer = buf[index+2:]
return buf[:index]
- def expect(self, text):
- line = self.readline()
+ def expect(self, text, raise_exception=False):
+ line = self.readline(raise_exception)
if line != text:
self.debuglog("while expecting '%s', got unexpected response '%s'"
% (text, line))
@@ -1151,6 +1197,10 @@
self.buffer = buf[rlen:]
return buf[:rlen]
+ def flush(self):
+ self.send_cmd('flush_all')
+ self.expect('OK')
+
def __str__(self):
d = ''
if self.deaduntil:
@@ -1158,6 +1208,8 @@
if self.family == socket.AF_INET:
return "inet:%s:%d%s" % (self.address[0], self.address[1], d)
+ elif self.family == socket.AF_INET6:
+ return "inet6:[%s]:%d%s" % (self.address[0], self.address[1], d)
else:
return "unix:%s%s" % (self.address, d)
@@ -1293,13 +1345,13 @@
print "Testing sending a unicode-string key...",
try:
- x = mc.set(u'keyhere', 1)
+ x = mc.set(unicode('keyhere'), 1)
except Client.MemcachedStringEncodingError, msg:
print "OK",
else:
print "FAIL",; failures = failures + 1
try:
- x = mc.set((u'a'*SERVER_MAX_KEY_LENGTH).encode('utf-8'), 1)
+ x = mc.set((unicode('a')*SERVER_MAX_KEY_LENGTH).encode('utf-8'), 1)
except:
print "FAIL",; failures = failures + 1
else:
@@ -1313,7 +1365,8 @@
else:
print "FAIL"; failures = failures + 1
- print "Testing using a value larger than the memcached value limit...",
+ print "Testing using a value larger than the memcached value limit..."
+ print 'NOTE: "MemCached: while expecting[...]" is normal...'
x = mc.set('keyhere', 'a'*SERVER_MAX_VALUE_LENGTH)
if mc.get('keyhere') == None:
print "OK",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-memcached-1.48/python_memcached.egg-info/PKG-INFO
new/python-memcached-1.51/python_memcached.egg-info/PKG-INFO
--- old/python-memcached-1.48/python_memcached.egg-info/PKG-INFO
2013-03-29 01:18:46.000000000 +0100
+++ new/python-memcached-1.51/python_memcached.egg-info/PKG-INFO
2013-05-06 23:30:11.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: python-memcached
-Version: 1.48
+Version: 1.51
Summary: Pure python memcached client
Home-page: http://www.tummy.com/Community/software/python-memcached/
Author: Sean Reifschneider
@@ -16,6 +16,14 @@
Please do not contact Evan about maintenance.
Sean Reifschneider of tummy.com, ltd. has taken over maintenance of it.
+ Please report issues and submit code changes to the github repository
at:
+
+ https://github.com/linsomniac/python-memcached
+
+ For changes prior to 2013-03-26, see the old Launchpad repository at:
+
+ Historic issues: https://launchpad.net/python-memcached
+
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-memcached-1.48/python_memcached.egg-info/SOURCES.txt
new/python-memcached-1.51/python_memcached.egg-info/SOURCES.txt
--- old/python-memcached-1.48/python_memcached.egg-info/SOURCES.txt
2013-03-29 01:18:46.000000000 +0100
+++ new/python-memcached-1.51/python_memcached.egg-info/SOURCES.txt
2013-05-06 23:30:11.000000000 +0200
@@ -1,4 +1,6 @@
-README
+ChangeLog
+MANIFEST.in
+README.md
memcache.py
setup.cfg
setup.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-memcached-1.48/setup.py
new/python-memcached-1.51/setup.py
--- old/python-memcached-1.48/setup.py 2011-11-28 02:17:32.000000000 +0100
+++ new/python-memcached-1.51/setup.py 2013-05-06 23:30:11.000000000 +0200
@@ -6,7 +6,7 @@
setup(name="python-memcached",
version=memcache.__version__,
description="Pure python memcached client",
- long_description=open("README").read(),
+ long_description=open("README.md").read(),
author="Evan Martin",
author_email="[email protected]",
maintainer="Sean Reifschneider",
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]