poplib - retr() getting stuck

Roopesh roopesh.raj at gmail.com
Thu Jun 26 12:23:12 CEST 2008


Thanks for the help.

At present I have modified the poplib code as follows (In POP3 and
POP3_SSL classes): Is it the correct way?

    def __init__(self, host, port = POP3_PORT):
        self.host = host
        self.port = port
        msg = "getaddrinfo returns an empty list"
        self.sock = None

	socket.setdefaulttimeout(30)

        for res in socket.getaddrinfo(self.host, self.port, 0,
socket.SOCK_STREAM):
            af, socktype, proto, canonname, sa = res
            try:
                self.sock = socket.socket(af, socktype, proto)
                self.sock.connect(sa)
            except socket.error, msg:

Thanks
Roopesh



More information about the Python-list mailing list