Issue 1448639: asyncore dispatcher.getattr() masks self._map (original) (raw)
The abstraction of socket_map in the asyncore module in Python 2.4 forgets to allow accesses to the internal attribute self._map in getattr(). This causes any asyncore application to fail in create_socket(), which pretty much renders asyncore inoperative in Python 2.4.
This problem was introduced in rev 34469 as a commit of Bug #758241.
Example backtrace, generated from an application that uses Medusa servers that don't use the private map function:
Traceback (most recent call last): File "/usr/local/qos/qosserver/qos_server.py", line 1576, in ? m = monitor.monitor_server ('127.0.0.1', BasePort) File "/usr/local/qos/qosserver/monitor.py", line 161, in init self.create_socket (socket.AF_INET, socket.SOCK_STREAM) File "/usr/local/lib/python2.4/asyncore.py", line 261, in create_socket self.add_channel() File "/usr/local/lib/python2.4/asyncore.py", line 244, in add_channel map = self._map File "/usr/local/lib/python2.4/asyncore.py", line 366, in getattr return getattr(self.socket, attr) AttributeError: '_socketobject' object has no attribute '_map'
getattr() should test if the attribute exists in its own object before passing it on to the underlying socket object.