Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support whitespaces in namespace #16

Merged
merged 1 commit into from

2 participants

@xpoft

And fix problem with bytes key (encoded in cache.py - Cache._get_value).

@xpoft xpoft Support whitespaces in namespace
And fix problem with bytes key (encoded in cache.py - Cache._get_value).
03e2933
@bbangert
Owner

Doesn't this have the possibility of changing existing keys used for caching and thus invalidating existing caches for people upgrading Beaker?

@xpoft

No.
Whitespaces in namespace is not supported now.
And decode need for key in bytes. Unable to concatenate string and bytes together.

@bbangert bbangert merged commit 00e018a into bbangert:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 25, 2012
  1. @xpoft

    Support whitespaces in namespace

    xpoft authored
    And fix problem with bytes key (encoded in cache.py - Cache._get_value).
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  beaker/ext/memcached.py
View
2  beaker/ext/memcached.py
@@ -99,7 +99,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
Something went wrong with that request. Please try again.