I found the problem. When the beaker_cache wrapper tries to _make_key,
it creates a key that has spaces in it, which memcached does not
allow.

It's not really the wrapper's fault, but rather the way in which
python represents a tuple -- with spaces.

I can make the above work by just stripping the spaces out of the key
in the _make_key function.

Jim

On Sep 10, 10:41 pm, Jim Musil <[EMAIL PROTECTED]> wrote:
> Hi, hope someone can help (or at least tell me it's possible)!
>
> I'm running pylons 0.9.5 and having trouble getting the beaker_cache
> wrapper to work with memcached.
>
> This seems to be the central problem in the trace:
>
> >  File "build/bdist.linux-i686/egg/memcache.py", line 873, in check_key
> >    raise Client.MemcachedKeyCharacterError, "Control characters not allowed"
> >MemcachedKeyCharacterError: Control characters not allowed
>
> Here's the sample code run from paster shell:
>
> from pylons.decorators.cache import beaker_cache
> @beaker_cache(key='cache_default',type='ext:memcached',expire='9600')
> def big(limit=1000):
>     s = 'START'
>     for i in range(limit):
>         s = s + "XXXXXXXXXXXX" + str(limit)
>     return s


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to