Message74614
My problem, and the problem if the original bug reporter (sirilyan) is
that the load method ignores names that don't have values. Quoting the
original bug report:
>>> import Cookie
>>> q = Cookie.SimpleCookie("pie=good; broken;
other=thing")
>>> q
<SimpleCookie: other='thing' pie='good'>
The original bug report suggested raising a warning or something. I
don't like that idea too much. What I would like to see is the "secure"
cookie parameter, which BY RFC has no value, be parsed as expected.
Right now is you .load() a cookie that looks like this: "a=b; secure"
and then you want to write that cookie back, you loose the secure parameter!
dz0@brick:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Cookie
>>> C = Cookie.SimpleCookie()
>>> C.load("chips=ahoy; vienna=finger")
>>> print C
Set-Cookie: chips=ahoy
Set-Cookie: vienna=finger
>>> C.load("chips=ahoy; vienna=finger; secure")
>>> print C
Set-Cookie: chips=ahoy
Set-Cookie: vienna=finger
>>>
I'm not sure if I'm being clear enough, please tell me if you need me to
rewrite something, or use other examples. |
|
Date |
User |
Action |
Args |
2008-10-10 02:15:33 | andresriancho | set | recipients:
+ andresriancho, akuchling, facundobatista, jjlee, sirilyan |
2008-10-10 02:15:33 | andresriancho | set | messageid: <1223604933.33.0.220705517332.issue1028088@psf.upfronthosting.co.za> |
2008-10-10 02:15:32 | andresriancho | link | issue1028088 messages |
2008-10-10 02:15:30 | andresriancho | create | |
|