Source

BeakerIssue31 / beaker / cache.py

Diff from to

beaker/cache.py

 :func:`.region_invalidate`.
 
 """
-
 import warnings
 
 import beaker.container as container
                                     "argument is required")
 
             if skip_self:
-                cache_key = " ".join(map(str, deco_args + args[1:]))
+                try:
+                    cache_key = " ".join(map(str, deco_args + args[1:]))
+                except UnicodeEncodeError:
+                    cache_key = " ".join(map(unicode, deco_args + args[1:]))
             else:
-                cache_key = " ".join(map(str, deco_args + args))
+                try:
+                    cache_key = " ".join(map(str, deco_args + args))
+                except UnicodeEncodeError:
+                    cache_key = " ".join(map(unicode, deco_args + args))
             def go():
                 return func(*args)