changes in threading and SocketServer since Python 2.0?

Kelly DeMarco kellydemarco at dontspamme.com
Thu Jul 12 06:54:06 EDT 2001


I used to use webdebug(http://www.cyberclip.com/webdebug/) on Python 1.6
without any problem, but I've been through some problem using it on Python
2.1 thesedays.

The source code is quite short and clear, so there doesn't seem to be any
good reason why it's failing on Python 2.1 -- maybe some changes in the
standard library?

What's more interesting is, when webdebug is run with singlethreaded mode,
there's no problem. Therefore, I guess it has something to do with
threading lib.

The platform is win32, and the error I get is:

Exception in thread Thread-13:
Traceback (most recent call last):
  File ".\threading.py", line 378, in __bootstrap
    self.run()
  File ".\threading.py", line 366, in run
    apply(self.__target, self.__args, self.__kwargs)
  File "c:\python21\lib\SocketServer.py", line 246, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "c:\python21\lib\SocketServer.py", line 495, in __init__
    self.handle()
  File "WDhandler.py", line 116, in handle
    self.httpRequest = HTTPrequest.HTTPrequest(self.rfile,
self.client_address)
  File "HTTPrequest.py", line 73, in __init__
    self.raw_requestline = self.readLine(input)
  File "HTTPmessage.py", line 69, in readLine
    str = input.readline()
  File "c:\python21\lib\socket.py", line 233, in readline
    new = self._sock.recv(self._rbufsize)
AttributeError: 'int' object has no attribute 'recv'
[as you see, the socket instance is erroneously an int object here -- and
it happens only when in threading mode using threadingmixins from
socketserver]

Can anyone help me out?  Thanks in advance.





More information about the Python-list mailing list