The correct solution on Python 3 is to encode it back to latin1 and decode
it from utf-8 as browsers do.
--
Ticket URL: <https://code.djangoproject.com/ticket/20557>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* needs_better_patch: => 0
* needs_tests: => 0
* owner: nobody => aaugustin
* needs_docs: => 0
* stage: Unreviewed => Accepted
Comment:
Agreed, that's what Django should do.
(I don't remember how this works currently.)
--
Ticket URL: <https://code.djangoproject.com/ticket/20557#comment:1>
Comment (by mitsuhiko):
I just noticed that the stdlib module has some issues with unicode on
Python 3. I am going to investigate how I'm going to solve this in
Werkzeug and will link you the solution once I have one.
--
Ticket URL: <https://code.djangoproject.com/ticket/20557#comment:2>
Comment (by mitsuhiko):
This is the solution I ended up with in Werkzeug for the time being:
https://github.com/mitsuhiko/werkzeug/commit/cf048aad79faa4675f8d90ab57928dc3e09808cb
--
Ticket URL: <https://code.djangoproject.com/ticket/20557#comment:3>
* type: Uncategorized => Bug
Comment:
We reached roughly the same conclusion; we just piled hacks upon hacks
instead of rewriting the whole thing like you did...
--
Ticket URL: <https://code.djangoproject.com/ticket/20557#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"8aaca651cf5732bbf395d24a7d9f2edfab00250c"]:
{{{
#!CommitTicketReference repository=""
revision="8aaca651cf5732bbf395d24a7d9f2edfab00250c"
Fixed #20557 -- Properly decoded non-ASCII cookies on Python 3.
Thanks mitsuhiko for the report.
Non-ASCII values are supported. Non-ASCII keys still aren't, because the
current parser mangles them. That's another bug.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20557#comment:5>
Comment (by Aymeric Augustin <aymeric.augustin@…>):
In [changeset:"fac5735a3daffb82b67ff489f0c963eaf953f6e7"]:
{{{
#!CommitTicketReference repository=""
revision="fac5735a3daffb82b67ff489f0c963eaf953f6e7"
[1.6.x] Fixed #20557 -- Properly decoded non-ASCII cookies on Python 3.
Thanks mitsuhiko for the report.
Non-ASCII values are supported. Non-ASCII keys still aren't, because the
current parser mangles them. That's another bug.
Simplified backport of 8aaca651 and f5add47 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20557#comment:6>
Comment (by Aymeric Augustin <aymeric.augustin@…>):
In [changeset:"f5add4712f684a78215263771b8acaeb48e64a81"]:
{{{
#!CommitTicketReference repository=""
revision="f5add4712f684a78215263771b8acaeb48e64a81"
Fixed tests introduced in previous commit on Python 2. Refs #20557.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20557#comment:7>