ftplib.FTP.retrbinary() hangs on completion

Fredrik Lundh fredrik at pythonware.com
Thu Jun 29 07:16:13 EDT 2006


"aum" <aum at spam.me.please> wrote:

> What happens is that after all the data comes in over the data connection,
> .retrbinary() does 'return self.voidresp()'. This has a call chain ending
> with 'self.file.readline()'.
>
> To investigate, I overrode the .getline() method with one
> which replaces the self.file.readline() with a self.sock.recv(1) loop, and
> determined from this that after the last byte of binary data comes in on
> the data connection, not a single byte comes in on the control connection.

since both sides has closed the data connection socket when you get that far, it
looks like the server you're talking to is broken; see

    http://cr.yp.to/ftp/retr.html

for details on what the server is supposed to do, and what the client can expect
from the server.

</F> 






More information about the Python-list mailing list