Permalink
Browse files

Merge pull request #16 from xpoft/patch-5

Support whitespaces in namespace
  • Loading branch information...
2 parents 791f5e4 + 03e2933 commit 00e018af1b6d8ffc37b0b5e060ee150e22d8c6e6 @bbangert committed May 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 beaker/ext/memcached.py
View
@@ -107,7 +107,7 @@ def get_creation_lock(self, key):
(self.namespace, key), lock_dir=self.lock_dir)
def _format_key(self, key):
- formated_key = self.namespace + '_' + key.replace(' ', '\302\267')
+ formated_key = (self.namespace + '_' + (key if isinstance(key, str) else key.decode('ascii'))).replace(' ', '\302\267')
if len(formated_key) > MAX_KEY_LENGTH:
formated_key = sha1(formated_key).hexdigest()
return formated_key

0 comments on commit 00e018a

Please sign in to comment.