joerussbowman / gaeutilities

gaeutilities - A collection of utilities to help with application development on Google Appengine
http://gaeutilities.appspot.com
BSD 3-Clause "New" or "Revised" License
78 stars 4 forks source link

Session fails in python 2.6 #15

Closed fredrikbonander closed 14 years ago

fredrikbonander commented 14 years ago

Alex Martelli has a elaborate explanation @ http://stackoverflow.com/questions/2652820/error-on-windows-using-session-from-appengine-utilities

Baseline is:

This fails in python 2.6

string_cookie = os.environ.get(u"HTTP_COOKIE", u"") self.cookie = Cookie.SimpleCookie() self.output_cookie = Cookie.SimpleCookie() self.cookie.load(string_cookie)

In python 2.6 Cookie.py lines 624-628: if type(rawdata) == type(""): self.**ParseString(rawdata) else:

self.update() wouldn't call our custom __setitem**

for k, v in rawdata.items():

"line 624 only parses a byte string: anything else (including a unicode string!) is treated like a dict (whence the crash)."

joerussbowman commented 14 years ago

Appengine, at the moment, only supports Python 2.5. I'd be more than willing to accept patches that make the libraries work with 2.6, my appengine environment is currently all 2.5 and I'm unfortunately too tied up with other projects to focus on getting anything 2.6 ready when Google is still on 2.5.

Does anyone know if Google intends to go to 2.6, or will the switch straight to 3?

joerussbowman commented 14 years ago

There is the issue of potentially calling cookie.load with an empty string, which is incorrect. I'll see when I get this fixed.

joerussbowman commented 14 years ago

I fixed the issue of calling cookie_load against an empty string.