Alexandre CONRAD wrote:
> # Test using use the "has_key" method
> >>> cache.get_cache("users").has_key("anonymous")
> False
> >>> cache.get_cache("users").has_key("foo")
> 0
This `has_key` method doesn't seem to support unicode strings. Should a
test be added if the key is a unicode and convert it to a str() before
continuing ?
>>> cache.get_cache("users").has_key(u"anonymous")
Traceback (most recent call last):
File "<console>", line 1, in ?
File
"/usr/lib/python2.4/site-packages/Beaker-0.6.3-py2.4.egg/beaker/cache.py",
line 96, in has_key
return container.has_current_value()
File
"/usr/lib/python2.4/site-packages/myghtyutils-0.52-py2.4.egg/myghtyutils/container.py",
line 346, in has_current_value
File
"/usr/lib/python2.4/site-packages/myghtyutils-0.52-py2.4.egg/myghtyutils/container.py",
line 322, in has_value
File
"/usr/lib/python2.4/site-packages/myghtyutils-0.52-py2.4.egg/myghtyutils/container.py",
line 92, in has_key
File
"/usr/lib/python2.4/site-packages/myghtyutils-0.52-py2.4.egg/myghtyutils/container.py",
line 624, in __contains__
File "/usr/lib64/python2.4/bsddb/__init__.py", line 248, in has_key
return self.db.has_key(key)
TypeError: String or Integer object expected for key, unicode found
Regards,
--
Alexandre CONRAD
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---