Sohaib Ahmad added the comment:

I manually reverted the issue26960 patch which fixed my issue of consecutive 
downloads but it also caused regression of issue26960.

I am looking into what could be causing this hang when voidresp() is called 
using the demo available in issue26960 and it looks when urlopen() is called 
following happens:

urlopen() > URLopener.open() > URLopener.open_ftp > ftpwrapper.retrfile() > 
FTP.ntransfercmd()

Now this retrfile() calls FTP.ntransfercmd() in ftplib which sends RETR command 
to ftp server which, if I understand correctly, means that retrieve a copy of 
the file from FTP server. If RETR does retrieve complete file then I think the 
behavior after reverting issue26960 patch is fine and the hang would be there 
for large files.

I think we can fix this freeze for large files but I have two questions 
regarding this:

1) Is urlopen() supposed to download complete files? From Python doc, it looks 
like it only returns a network object or an exception in case of invalid URL.

2) If it is not supposed to download complete files, can we switch to LIST 
instead of RETR for FTP files?

I'd be grateful if a urllib / ftplib expert can answer the above questions.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27973>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to