Senthil orsent...@gmail.com added the comment:
Cookie.Cookie is deprecated in Py2k. In Py3k, it is
http.cookies.SimpleCookie. The bug was present in Py3k, the attached
patch fixes it.
--
assignee: - orsenthil
nosy: +orsenthil
resolution: - accepted
Added file:
Senthil orsent...@gmail.com added the comment:
Because SimpleCookie class is still usable (that is not deprecated), it
makes sense to back port to Py2.7.
Applied the patches in revision 71030 and r71029. Thanks.
--
status: open - closed
versions: +Python 3.1
Noufal nou...@nibrahim.net.in added the comment:
What's wrong with and ?
I can see the issues with ; though.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4860
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
What's wrong with and ?
c=Cookie.Cookie('Customer=/script;'); print c.js_output()
script type=text/javascript
!-- begin hiding
document.cookie = Customer=/script;
// end hiding --
/script
STINNER Victor victor.stin...@haypocalc.com added the comment:
The patch looks correct but it breaks the unit test: updated patch
fixes Lib/test/test_cookie.py.
--
nosy: +haypo
Added file: http://bugs.python.org/file12632/cookie-2.patch
___
Python
Noufal nou...@nibrahim.net.in added the comment:
A lot of the cookie tests need to be updated. A separate bug was filed
regarding this. http://bugs.python.org/issue3788.
I'm working on that now and will apply your patch there as well.
___
Python tracker
STINNER Victor victor.stin...@haypocalc.com added the comment:
The characters should also be escaped.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4860
___
New submission from Noufal nou...@nibrahim.net.in:
If a cookie is created with a character in the content, the js_output
which is emitted is bad javascript. eg.
import Cookie
c=Cookie.Cookie('Customer=WILE_E_COYOTE; Version=1; Path=/acme')
print c
Set-Cookie: Customer=WILE_E_COYOTE;