[Trac-tickets] [The Trac Project] #3043: Intermittent error due to
`environ` being `None` in TracStandalone
The Trac Project
noreply at edgewall.com
Sun Apr 16 05:46:32 CDT 2006
#3043: Intermittent error due to `environ` being `None` in TracStandalone
--------------------+-------------------------------------------------------
Reporter: cboos | Owner: jonas
Type: defect | Status: new
Priority: normal | Milestone:
Component: tracd | Version: devel
Severity: minor | Keywords: wsgi
--------------------+-------------------------------------------------------
This happens from time to times, either when reading or writing to
`environ`. Here's a backtrace obtained when trying to write into
`environ`, which happens to be `None`.
{{{
localhost - - [16/Apr/2006 12:35:15] "GET
/devel/chrome/common/trac_banner.png HTTP/1.1" 200 -
localhost - - [16/Apr/2006 12:35:15] "GET
/devel/chrome/common/trac_logo_mini.png HTTP/1.1" 200 -
localhost - - [16/Apr/2006 12:35:15] "GET /devel/chrome/common/dots.gif
HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 1553)
Traceback (most recent call last):
File "C:\Program Files\ActiveState\Python-2.4\lib\SocketServer.py", line
463, in process_request_thread
self.finish_request(request, client_address)
File "C:\Program Files\ActiveState\Python-2.4\lib\SocketServer.py", line
254, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Program Files\ActiveState\Python-2.4\lib\SocketServer.py", line
521, in __init__
localhost - - [16/Apr/2006 12:35:15] "GET /devel/chrome/common/trac.ico
HTTP/1.1" 200 -
self.handle()
File "C:\Program Files\ActiveState\Python-2.4\lib\BaseHTTPServer.py",
line 316, in handle
self.handle_one_request()
File "C:\Workspace\install\lib\python\trac\devel\lib\site-
packages\trac\web\wsgi.py", line 173, in handle_one_request
localhost - - [16/Apr/2006 12:35:15] "GET
/devel/chrome/common/topbar_gradient2.png HTTP/1.1" 200 -
gateway = self.server.gateway(self, environ)
File "C:\Workspace\install\lib\python\trac\devel\lib\site-
packages\trac\web\wsgi.py", line 187, in __init__
_ErrorsWrapper(lambda x: handler.log_error('%s', x)))
File "C:\Workspace\install\lib\python\trac\devel\lib\site-
packages\trac\web\wsgi.py", line 69, in __init__
environ['wsgi.version'] = self.wsgi_version
TypeError: object does not support item assignment
----------------------------------------
localhost - - [16/Apr/2006 12:35:15] "GET /devel/chrome/common/asc.png
HTTP/1.1" 200 -
localhost - - [16/Apr/2006 12:35:15] "GET /devel/chrome/common/folder.png
HTTP/1.1" 200 -
localhost - - [16/Apr/2006 12:35:15] "GET /devel/chrome/common/parent.png
HTTP/1.1" 200 -
}}}
This Python 2.4.2, on Windows (but happened also with 2.3.5).
After some code inspection, it seems that in
`WSGIRequestHandler.setup_environ`,
there's this code path:
{{{
self.raw_requestline = self.rfile.readline()
if not self.parse_request(): # An error code has been sent, just
exit
self.close_connection = 1
return
}}}
which is certainly the reason for the above error.
I'm not sure what's going on here, as neither `raw_requestline`,
nor `close_connection` seems to be used anywhere else...
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/3043>
The Trac Project <http://trac.edgewall.com/>
More information about the Trac-Tickets
mailing list