Ahh. Problem solved. I was calling: response.delete_cookie(key=color_id)
color_id was a string. When I did this: for key in request.COOKIES.keys(): if key == color_id: response.delete_cookie(key=key) It worked. It seems that passing a unicode string rather than a python string is what causes the problem. The only difference between key and color_id is this: color_id u'colorcompare73936' key 'colorcompare73936' color_id has the u'...' I then tried: response.delete_cookie(key=str(color_id)) and it worked fine. Should I report this as a bug? On Wed, Aug 18, 2010 at 10:42 PM, Dane Larsen <dane.t.lar...@gmail.com>wrote: > Environment: > > Request Method: GET > Request URL: http://*********.com/colors/delete/colorcompare89441/ > Django Version: 1.2.1 > Python Version: 2.6.5 > Installed Applications: > ['django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.sites', > 'django.contrib.messages'] > Installed Middleware: > ('django.middleware.common.CommonMiddleware', > 'django.contrib.sessions.middleware.SessionMiddleware', > 'django.middleware.csrf.CsrfViewMiddleware', > 'django.contrib.auth.middleware.AuthenticationMiddleware', > 'django.contrib.messages.middleware.MessageMiddleware') > > > Traceback: > File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" > in get_response > 100. response = callback(request, *callback_args, > **callback_kwargs) > File "/home/dane/larsendt/../larsendt/colorcompare/views.py" in delete > 86. response.delete_cookie(key=color_id, path='/') > File "/usr/local/lib/python2.6/dist-packages/django/http/__init__.py" in > delete_cookie > 390. expires='Thu, 01-Jan-1970 00:00:00 GMT') > File "/usr/local/lib/python2.6/dist-packages/django/http/__init__.py" in > set_cookie > 376. self.cookies[key] = value > File "/usr/lib/python2.6/Cookie.py" in __setitem__ > 585. self.__set(key, rval, cval) > File "/usr/lib/python2.6/Cookie.py" in __set > 578. M.set(key, real_value, coded_value) > File "/usr/lib/python2.6/Cookie.py" in set > 454. if "" != translate(key, idmap, LegalChars): > File "/usr/lib/python2.6/string.py" in translate > 493. return s.translate(table, deletions) > > Exception Type: TypeError at /colors/delete/colorcompare89441/ > Exception Value: translate() takes exactly one argument (2 given) > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.