Issue11130
Created on 2011-02-05 16:57 by ProgVal, last changed 2011-02-05 17:15 by orsenthil. This issue is now closed.
| Messages (5) | |||
|---|---|---|---|
| msg127999 - (view) | Author: ProgVal (ProgVal) | Date: 2011-02-05 16:57 | |
Hello,
I have issues with a script I'm programming (TypeError at every client connection), so I edited BaseServer's __init__():
def __init__(self, server_address, RequestHandlerClass):
"""Constructor. May be extended, do not override."""
if isinstance(server_address, socket._socketobject):
raise Exception()
self.server_address = server_address
self.RequestHandlerClass = RequestHandlerClass
self.__is_shut_down = threading.Event()
self.__shutdown_request = False
And it raises sometimes this traceback:
Exception happened during processing of request from ('127.0.0.1', 32810)
Traceback (most recent call last):
File "/usr/lib/python2.6/SocketServer.py", line 285, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 311, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.6/SocketServer.py", line 324, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.6/SocketServer.py", line 400, in __init__
BaseServer.__init__(self, server_address, RequestHandlerClass)
File "/usr/lib/python2.6/SocketServer.py", line 198, in __init__
raise Exception()
Best regards,
ProgVal
|
|||
| msg128000 - (view) | Author: ProgVal (ProgVal) | Date: 2011-02-05 16:59 | |
The problem happens on Python 2.7 too.
Additionaly, here is the traceback, if I don't edit the library:
Exception happened during processing of request from ('127.0.0.1', 50378)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 408, in __init__
self.server_bind()
File "/usr/lib/python2.7/SocketServer.py", line 419, in server_bind
self.socket.bind(self.server_address)
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
TypeError: getsockaddrarg: AF_INET address must be tuple, not _socketobject
|
|||
| msg128002 - (view) | Author: ProgVal (ProgVal) | Date: 2011-02-05 17:12 | |
This seems odd to me: this line:
self.RequestHandlerClass(request, client_address, self)
calls TCPServer's constructor:
def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True):
|
|||
| msg128003 - (view) | Author: ProgVal (ProgVal) | Date: 2011-02-05 17:14 | |
Oooooh, excuse me, it's because of my code! class MyRequestHandler(SocketServer.TCPServer): |
|||
| msg128004 - (view) | Author: Senthil Kumaran (orsenthil) * ![]() |
Date: 2011-02-05 17:15 | |
Unable to determine the bug here. If you have questions with using python, please ask python-list@python.org |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2011-02-05 17:15:45 | orsenthil | set | status: open -> closed nosy: + orsenthil messages: + msg128004 type: behavior stage: committed/rejected |
| 2011-02-05 17:14:14 | ProgVal | set | resolution: invalid messages: + msg128003 |
| 2011-02-05 17:12:21 | ProgVal | set | messages: + msg128002 |
| 2011-02-05 16:59:44 | ProgVal | set | messages:
+ msg128000 versions: + Python 2.7 |
| 2011-02-05 16:57:24 | ProgVal | create | |
