From 664bd3e23fe500fbde4c70636e2d24c8fd2f35af Mon Sep 17 00:00:00 2001 From: Sean Reifschneider Date: Fri, 31 Jul 2015 11:46:13 -0600 Subject: Fix for value being boolean in set(). --- ChangeLog | 7 +++++++ memcache.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd64339..8743b7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri, 31 Jul 2015 11:38:25 -0600 Sean Reifschneider + + * 1.57 release. + + * Fix for #75 and #76, mc.set(key, False) results in "ValueError: + invalid literal for int()". Reported by Carlos Sanchez on github. + Sun, 26 Jul 2015 14:44:20 -0600 Sean Reifschneider * 1.56 release. diff --git a/memcache.py b/memcache.py index 60aa186..f5b9f49 100644 --- a/memcache.py +++ b/memcache.py @@ -90,7 +90,7 @@ valid_key_chars_re = re.compile(b'[\x21-\x7e\x80-\xff]+$') # Original author: Evan Martin of Danga Interactive __author__ = "Sean Reifschneider " -__version__ = "1.56" +__version__ = "1.57" __copyright__ = "Copyright (C) 2003 Danga Interactive" # http://en.wikipedia.org/wiki/Python_Software_Foundation_License __license__ = "Python Software Foundation License" @@ -934,7 +934,7 @@ class Client(threading.local): val = val.encode('utf-8') elif isinstance(val, int): flags |= Client._FLAG_INTEGER - val = str(val) + val = '%d' % val if six.PY3: val = val.encode('ascii') # force no attempt to compress this silly string. -- cgit v1.2.1