Well, regardless, it works if you convert it to a str first.
Thanks for the help!
On Thu, Aug 19, 2010 at 11:02 AM, Rolando Espinoza La Fuente <
dark...@gmail.com> wrote:
> On Thu, Aug 19, 2010 at 12:14 PM, Dane Larsen
> wrote:
> [...]
> > I then tried:
> >
On Thu, Aug 19, 2010 at 12:14 PM, Dane Larsen wrote:
[...]
> I then tried:
> response.delete_cookie(key=str(color_id))
> and it worked fine.
> Should I report this as a bug?
Cookie.Morsel does not handle unicode strings, mainly because
string.translate expects
two
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
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',
On Wed, Aug 18, 2010 at 5:58 PM, larsendt wrote:
> The relevant code is simple:
>
> response = HttpResponseRedirect('/colors/')
> response.delete_cookie(key=color_id, path='/')
> return response
>
> But when I try to run it, I get the error:
>
> TypeError at
The relevant code is simple:
response = HttpResponseRedirect('/colors/')
response.delete_cookie(key=color_id, path='/')
return response
But when I try to run it, I get the error:
TypeError at /colors/delete/colorcompare29108/
translate() takes exactly one argument (2 given)
6 matches
Mail list logo