Issue2114

classification
Title: Cookie.load exception with unicode strings
Type: behaviour Severity: normal
Components: Library Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: aksian, indra, zyasoft
Priority: Keywords:

Created on 2014-02-17.08:34:26 by aksian, last changed 2014-06-30.17:37:19 by zyasoft.

Messages
msg8241 (view) Author: Andrei Terentiev (aksian) Date: 2014-02-17.08:34:25
http://docs.python.org/2/library/cookie.html#example

Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52) 
[OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_25
Type "help", "copyright", "credits" or "license" for more information.
>>> import Cookie
>>> C = Cookie.SimpleCookie()
>>> C.load("chips=ahoy; vienna=finger")
>>> C.load(u"chips=ahoy; vienna=finger")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/www-data/com-piter/servlet/ROOT/WEB-INF/lib/jython-standalone-2.7-b1.jar/Lib/Cookie.py", line 635, in load
AttributeError: 'unicode' object has no attribute 'items'
>>>
msg8847 (view) Author: Indra Talip (indra) Date: 2014-06-29.08:48:26
This also fails on C Python 2.7

> python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Cookie
>>> C = Cookie.SimpleCookie()
>>> C.load("chips=ahoy; vienna=finger")
>>> C.load(u"chips=ahoy; vienna=finger")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/Cookie.py", line 632, in load
    for k, v in rawdata.items():
AttributeError: 'unicode' object has no attribute 'items'

Looking at the implementations for 2.7 and 3.4 it appears that Cookie.load() doesn't support a unicode string as input.
msg8852 (view) Author: Jim Baker (zyasoft) Date: 2014-06-30.17:37:19
Indra, thanks for investigating. This makes sense given that Cookie is pure Python.

Given that this is standard Python behavior, won't fix in Jython.
History
Date User Action Args
2014-06-30 17:37:19zyasoftsetstatus: open -> closed
resolution: wont fix
messages: + msg8852
nosy: + zyasoft
2014-06-29 08:48:26indrasetnosy: + indra
messages: + msg8847
2014-02-17 08:34:26aksiancreate