diff options
| author | Sean Reifschneider <jafo@guin.tummy.com> | 2009-11-27 18:28:29 -0700 |
|---|---|---|
| committer | Sean Reifschneider <jafo@guin.tummy.com> | 2009-11-27 18:28:29 -0700 |
| commit | c5203158e61f01ad6b86520d52d0c99756343e37 (patch) | |
| tree | 4935ca4e5327b811e3608e661ad67baaee218bdc | |
| parent | aa973f034fdfe4801db987afda8191177edefc04 (diff) | |
| download | python-memcached-c5203158e61f01ad6b86520d52d0c99756343e37.tar.gz | |
* Rejecting keys that have spaces in them. Patch by Etienne Posthumus.
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | memcache.py | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -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 |
