Dump Error:
Traceback (most recent call last):
File "/base/data/home/apps/s~tagtoo-ec/1.361220954515344675/libs/handlers.py", line 69, in get
self.beforeFilter()
File "/base/data/home/apps/s~tagtoo-ec/1.361220954515344675/libs/handlers.py", line 51, in beforeFilter
self.set_track()
File "/base/data/home/apps/s~tagtoo-ec/1.361220954515344675/libs/handlers.py", line 99, in set_track
track_id = self.request.cookies.get("tagtoo_user_track", None)
File "/base/python_runtime/python_lib/versions/1/webob/__init__.py", line 985, in cookies
vars = self.str_cookies
File "/base/python_runtime/python_lib/versions/1/webob/__init__.py", line 973, in str_cookies
cookies.load(source)
File "/base/python_runtime/python_dist/lib/python2.5/Cookie.py", line 619, in load
self.__ParseString(rawdata)
File "/base/python_runtime/python_dist/lib/python2.5/Cookie.py", line 650, in __ParseString
self.__set(K, rval, cval)
File "/base/python_runtime/python_dist/lib/python2.5/Cookie.py", line 572, in __set
M.set(key, real_value, coded_value)
File "/base/python_runtime/python_dist/lib/python2.5/Cookie.py", line 451, in set
raise CookieError("Illegal key value: %s" % key)
CookieError: Illegal key value: tagtoo_u{er_track
我多次收到此错误消息。
问题是
这是谷歌应用引擎的错误吗?
又发生了另一个cookie密钥“tagtoo_user_track”。 看起来cookie引擎不喜欢“s”。
Traceback (most recent call last):
File "/base/data/home/apps/s~tagtoo-ec/1.361220954515344675/libs/handlers.py", line 69, in get
self.beforeFilter()
File "/base/data/home/apps/s~tagtoo-ec/1.361220954515344675/libs/handlers.py", line 51, in beforeFilter
self.set_track()
File "/base/data/home/apps/s~tagtoo-ec/1.361220954515344675/libs/handlers.py", line 99, in set_track
track_id = self.request.cookies.get("tagtoo_user_track", None)
File "/base/python_runtime/python_lib/versions/1/webob/__init__.py", line 985, in cookies
vars = self.str_cookies
File "/base/python_runtime/python_lib/versions/1/webob/__init__.py", line 973, in str_cookies
cookies.load(source)
File "/base/python_runtime/python_dist/lib/python2.5/Cookie.py", line 619, in load
self.__ParseString(rawdata)
File "/base/python_runtime/python_dist/lib/python2.5/Cookie.py", line 650, in __ParseString
self.__set(K, rval, cval)
File "/base/python_runtime/python_dist/lib/python2.5/Cookie.py", line 572, in __set
M.set(key, real_value, coded_value)
File "/base/python_runtime/python_dist/lib/python2.5/Cookie.py", line 451, in set
raise CookieError("Illegal key value: %s" % key)
CookieError: Illegal key value: tagtoo_user_ses{ion
答案 0 :(得分:0)
看起来像cookie字符串中存在格式错误。 只要用户使用相关的cookie值,python 2.5 cookies lib就会引发异常。
可以通过检测错误的cookie值
self.request.environ.get("HTTP_COOKIE")
因此,我会在提出异常时手动解析cookie以避免此问题。