Strange Telnet error

Tim Roberts timr at
Fri Sep 20 06:23:44 CEST 2002

mnations at (Marc) wrote:
>I have been running some code that all the sudden stopped working. I
>can not figure out what's happened. I am doing a simple telnet
>connection that sends and receives info. Now I am getting this error:
>Traceback (most recent call last):
>  File "C:\Python22\lib\", line 408, in __bootstrap
>  File "C:\Python22\lib\", line 396, in run
>    apply(self.__target, self.__args, self.__kwargs)
>  File "", line 85, in run
>    command[0](*command[1:3])
>  File "", line 92, in command
>    conn.write(com)
>  File "C:\python22\lib\", line 272, in write
>    self.sock.sendall(buffer)
>AttributeError: 'int' object has no attribute 'sendall'
>Has anyone ever seen this before? If so, what could do this be related

I'm guessing you continued to try to do work after closing the connection.
Note this code at line 247:

    def close(self):
        """Close the connection."""
        if self.sock:
        self.sock = 0    # <<<< this makes self.sock an integer
        self.eof = 1

Your code is multithreaded.  Could another thread have closed the socket on
- Tim Roberts, timr at
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list