summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Reifschneider <jafo@guin.tummy.com>2009-11-27 18:28:29 -0700
committerSean Reifschneider <jafo@guin.tummy.com>2009-11-27 18:28:29 -0700
commitc5203158e61f01ad6b86520d52d0c99756343e37 (patch)
tree4935ca4e5327b811e3608e661ad67baaee218bdc
parentaa973f034fdfe4801db987afda8191177edefc04 (diff)
downloadpython-memcached-c5203158e61f01ad6b86520d52d0c99756343e37.tar.gz
* Rejecting keys that have spaces in them. Patch by Etienne Posthumus.
-rw-r--r--ChangeLog2
-rw-r--r--memcache.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f2c89f..51dec66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+ * 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.
diff --git a/memcache.py b/memcache.py
index 043a313..e59a906 100644
--- a/memcache.py
+++ b/memcache.py
@@ -1059,9 +1059,9 @@ def check_key(key, key_extra_len=0):
raise Client.MemcachedKeyLengthError("Key length is > %s"
% SERVER_MAX_KEY_LENGTH)
for char in key:
- if ord(char) < 32 or ord(char) == 127:
+ if ord(char) < 33 or ord(char) == 127:
raise Client.MemcachedKeyCharacterError(
- "Control characters not allowed")
+ "Control and space characters not allowed in keys")
def _doctest():
import doctest, memcache