[Paste] HTTPServer: TypeError: 'NoneType' object is unsubscriptable

20 views
Skip to first unread message

remo

unread,
Aug 24, 2010, 7:44:27 AM8/24/10
to Paste Users
Hi Folks!

I'm using Paste's HTTPServer as web server for our project, on top of
which our own framework runs. All works fine, except sometimes, we
can't actually reproduce when exactly, the following exception occurs:

----------------
Exception happened during processing of request from None
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/
httpserver.py", line 1068, in process_request_in_thread
self.finish_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/SocketServer.py", line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/SocketServer.py", line 615, in __init__
self.handle()
File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/
httpserver.py", line 442, in handle
BaseHTTPRequestHandler.handle(self)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/
httpserver.py", line 437, in handle_one_request
self.wsgi_execute()
File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/
httpserver.py", line 283, in wsgi_execute
self.wsgi_setup(environ)
File "/Library/Python/2.6/site-packages/Paste-1.7.4-py2.6.egg/paste/
httpserver.py", line 205, in wsgi_setup
remote_address = self.client_address[0]
TypeError: 'NoneType' object is unsubscriptable
----------------

The strange thing is, this happens sometimes even without a request,
so ie. on server startup. Does anyone have an idea what the problem
might be?

Thank you all a lot!
Remo

Ian Bicking

unread,
Aug 30, 2010, 3:33:06 PM8/30/10
to remo, Paste Users
Hmm... the client address comes from socket.accept() (http://docs.python.org/library/socket.html#socket.socket.accept) though through several level of subclasses.  But I think this would have to mean .accept() was returning None for the client address, or *maybe* some thread problem... but I doubt it's a thread problem.  There's no documented reason for accept to return None, but sockets seem to have lots of corner cases.  I'm personally not aware of anything related to this... maybe someone else on the list is?


--
You received this message because you are subscribed to the Google Groups "Paste Users" group.
To post to this group, send email to paste...@googlegroups.com.
To unsubscribe from this group, send email to paste-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/paste-users?hl=en.




--
Ian Bicking  |  http://blog.ianbicking.org
Reply all
Reply to author
Forward
0 new messages