Issue #778 resolved

CherryPy 2.3.0 breaks on Python2.3

guest
created an issue

CherryPy 2.3 and Python2.3 make CherryPy crash when trying to parse the headers with this traceback: {{{ Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/CherryPy-2.3.0-py2.3.egg/cherrypy/_cpwsgiserver.py", line 235, in run request.parse_request() File "/usr/lib/python2.3/site-packages/CherryPy-2.3.0-py2.3.egg/cherrypy/_cpwsgi.py", line 169, in parse_request _cpwsgiserver.HTTPRequest.parse_request(self) File "/usr/lib/python2.3/site-packages/CherryPy-2.3.0-py2.3.egg/cherrypy/_cpwsgiserver.py", line 151, in parse_request for k in headers: File "/usr/lib/python2.3/rfc822.py", line 390, in getitem return self.dict[name.lower()] AttributeError: 'int' object has no attribute 'lower' }}}

Changing line 150 of _cpwsgiserver.py from {{{for k in headers:}}} to {{{for k in headers.keys():}}} seems to resolve the problem.

Comments (3)

  1. Anonymous

    Thanks for fixing this. The reason why this breaks in Python 2.3 is Python Bug #1030125. By the way, you should also consider replacing mimetools with email, since mimetools is deprecated since Python 2.3.

  2. Log in to comment