[issue4791] retrlines('LIST') and dir hang at end of listing in ftplib (python3.0)

STINNER Victor report at bugs.python.org
Fri Jan 2 15:16:32 CET 2009


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Can you paste the full output with debuglevel=3?

"if not line:" should be equivalent to "if len(line) == 0:" and to "if 
line == '':".

ftp.dir() is equivalent to ftp.retrlines('LIST').

By default, the socket created to get the result of LIST has no 
timeout (is blocking). So fp.readline() only returns an empty string 
when the socket is closed (by the server).

fp is a io.BufferedReader(SocketIO(socket, "r"), 
io.DEFAULT_BUFFER_SIZE).

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4791>
_______________________________________


More information about the Python-bugs-list mailing list