Pylons/Paste bug in cookie-handling code?

25 views
Skip to first unread message

Max Ischenko

unread,
Jul 30, 2007, 12:37:31 AM7/30/07
to pylons-discuss
Hello,

Here is the traceback I got from time to time on my app. The app is
running on 0.9.6rc1 but I had the same error on 0.9.5 as well. I
didn't report it earlier since I thought it could resolve itself after
upgrade.

Max.

URL: http://www.developers.org.ua/_pylons/job-offers
File '/usr/lib/python2.4/site-packages/Paste-1.3-py2.4.egg/paste/
exceptions/errormiddleware.py', line 140 in __call__
app_iter = self.application(environ, detect_start_response)
File '/usr/lib/python2.4/site-packages/Paste-1.3-py2.4.egg/paste/
httpexceptions.py', line 633 in __call__
self.send_http_response, catch=HTTPException)
File '/usr/lib/python2.4/site-packages/Paste-1.3-py2.4.egg/paste/
wsgilib.py', line 225 in catch_errors_app
app_iter = application(environ, start_response)
File '/home/dou/lib/python2.4/site-packages/Pylons-0.9.6rc1-py2.4.egg/
pylons/wsgiapp.py', line 292 in __call__
return self.app(environ, start_response)
File '/home/dou/lib/python2.4/site-packages/Beaker-0.7.4-py2.4.egg/
beaker/cache.py', line 180 in __call__
return self.app(environ, start_response)
File '/home/dou/lib/python2.4/site-packages/Beaker-0.7.4-py2.4.egg/
beaker/session.py', line 393 in __call__
response = self.wrap_app(environ, session_start_response)
File '/home/dou/lib/python2.4/site-packages/Routes-1.7-py2.4.egg/
routes/middleware.py', line 104 in __call__
response = self.app(environ, start_response)
File '/home/dou/lib/python2.4/site-packages/Pylons-0.9.6rc1-py2.4.egg/
pylons/wsgiapp.py', line 88 in __call__
response = self.dispatch(controller, environ, start_response)
File '/home/dou/lib/python2.4/site-packages/Pylons-0.9.6rc1-py2.4.egg/
pylons/wsgiapp.py', line 214 in dispatch
return controller(environ, start_response)
File '/home/dou/doupy/doupy/lib/base.py', line 144 in __call__
lang = get_ui_language(request)
File '/home/dou/doupy/doupy/lib/base.py', line 95 in get_ui_language
sitelang = request.cookies.get('sitelang')
File '/usr/lib/python2.4/site-packages/Paste-1.3-py2.4.egg/paste/
registry.py', line 125 in __getattr__
return getattr(self._current_obj(), attr)
File '/usr/lib/python2.4/site-packages/Paste-1.3-py2.4.egg/paste/
wsgiwrappers.py', line 240 in cookies
return get_cookie_dict(self.environ)
File '/usr/lib/python2.4/site-packages/Paste-1.3-py2.4.egg/paste/
request.py', line 68 in get_cookie_dict
cookies.load(header)
File '/usr/lib/python2.4/Cookie.py', line 621 in load
self.__ParseString(rawdata)
File '/usr/lib/python2.4/Cookie.py', line 652 in __ParseString
self.__set(K, rval, cval)
File '/usr/lib/python2.4/Cookie.py', line 574 in __set
M.set(key, real_value, coded_value)
File '/usr/lib/python2.4/Cookie.py', line 453 in set
raise CookieError("Illegal key value: %s" % key)
CookieError: Illegal key value: 070-it-:><?0


CGI Variables
-------------
ACTUAL_SERVER_PROTOCOL: 'HTTP/1.1'
HTTP_ACCEPT: 'text/html, application/xml;q=0.9, application/xhtml
+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1'
HTTP_ACCEPT_CHARSET: 'iso-8859-1, utf-8, utf-16, *;q=0.1'
HTTP_ACCEPT_ENCODING: 'deflate, gzip, x-gzip, identity, *;q=0'
HTTP_ACCEPT_LANGUAGE: 'ru_RU,ru;q=0.9,en;q=0.8'
HTTP_COOKIE: '...'
HTTP_COOKIE2: '$Version=1'
HTTP_HOST: 'www.developers.org.ua'
HTTP_MAX_FORWARDS: '10'
HTTP_REFERER: 'http://www.developers.org.ua/company-db/celenia/
comment-page-2/'
HTTP_USER_AGENT: 'Opera/9.00 (Windows NT 5.1; U; ru)'
HTTP_VIA: '1.1 www.developers.org.ua'
HTTP_X_FORWARDED_FOR: '77.47.128.133'
HTTP_X_FORWARDED_HOST: 'www.developers.org.ua'
PATH_INFO: '/job-offers'
REMOTE_ADDR: '127.0.0.1'
REMOTE_PORT: '48333'
REQUEST_METHOD: 'GET'
SCRIPT_NAME: '/_pylons'
SERVER_NAME: 'developers.org.ua'
SERVER_PORT: '5003'
SERVER_PROTOCOL: 'HTTP/1.1'
SERVER_SOFTWARE: 'CherryPy/3.0.1 WSGI Server'

Ian Bicking

unread,
Jul 30, 2007, 12:59:26 AM7/30/07
to pylons-...@googlegroups.com
Max Ischenko wrote:
> File '/usr/lib/python2.4/Cookie.py', line 453 in set
> raise CookieError("Illegal key value: %s" % key)
> CookieError: Illegal key value: 070-it-:><?0
>
> HTTP_COOKIE: '...'
> HTTP_COOKIE2: '$Version=1'

Weird... I'm not sure how this exception and this cookie fit together
(unless you've removed the cookie value?). But probably errors in
parsing cookies should be warnings, not exceptions.

--
Ian Bicking : ia...@colorstudy.com : http://blog.ianbicking.org
: Write code, do good : http://topp.openplans.org/careers

Max Ischenko

unread,
Jul 30, 2007, 1:16:19 AM7/30/07
to pylons-...@googlegroups.com
On 7/30/07, Ian Bicking <ia...@colorstudy.com> wrote:

Max Ischenko wrote:
> File '/usr/lib/python2.4/Cookie.py', line 453 in set
>   raise CookieError("Illegal key value: %s" % key)
> CookieError: Illegal key value: 070-it-:><?0
>
>   HTTP_COOKIE: '...'
>   HTTP_COOKIE2: '$Version=1'

Weird... I'm not sure how this exception and this cookie fit together
(unless you've removed the cookie value?).  But probably errors in
parsing cookies should be warnings, not exceptions.

Oh, I should have retained HTTP_COOKIE value. Here it is
HTTP_COOKIE: 'dbx-postmeta=grabit=0-,1-,2-,3-,4-,5-,6-&advancedstuff=0-,1-,2-; __utmz=174710455.1185388743.48.4.utmccn=(referral)|utmcsr=alkweb.wordpress.com|utmcct=/2007/06/09/\x11070-it-:><?0=89-A->B7K20<
8-@01>B=8:>2/|utmcmd=referral; __utma=174710455.1445707320.1184270210.1185623274.1180728009.69; __utmc=174710455; __utmb=174710455'

The offending part belongs to one of the google analytics key.

Max.


Reply all
Reply to author
Forward
0 new messages