Socket error problem

Martin v. Loewis martin at v.loewis.de
Sun Jun 9 22:16:35 CEST 2002


"David LeBlanc" <whisper at oz.net> writes:

> The general.* constant references are to colorize the output which is turned
> off but still results in the "31" in the connection error line in the
> program output below. NOTE: I didn't write this code, so I have no idea why
> it's returning the username in the socket.error instead of the host. FWIW,
> this code is running in a thread, but there is only one thread trying to get
> mail.

That deserves some investigation since this, again, sounds impossible
(how can it possibly know what the user name as, when this piece of is
not being passed the user name). The only possible explanation is that
self.error_msg prints unrelated information; I recommend to remove all
except clauses and let the exception pass through.

>                 self.sock = socket.socket(af, socktype, proto)

Please put a print statement before this socket call, to print all
three arguments.

>                 self.sock.connect(sa)
>             except socket.error, msg:

And put one here, printing socket.error.

Regards,
Martin



More information about the Python-list mailing list