New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
urllib hangs when closing connection #60474
Comments
With version 3.3 (64 bit on Arch Linux) Python now hangs when closing FTP connection on some sites: url = "ftp://ftp.fu-berlin.de/pub/misc/movies/database/ratings.list.gz"
with urllib.request.urlopen( url ):
pass |
I guess this is about urllib, not ftplib. |
Well, urllib calls ftplib for ftp urls, so it might be about ftplib. But in that case it would be better to have a reproducer that *just* uses ftplib. |
I can reproduce the issue on python 3.3. import urllib.request
import ftplib
ftplib.FTP.debugging = 4
url = "ftp://ftp.fu-berlin.de/pub/misc/movies/database/ratings.list.gz"
with urllib.request.urlopen(url):
pass The problem appears to be endtransfer() erroneously calling ftp.voidresp() (it just shouldn't): |
New changeset edeeb727df86 by Giampaolo Rodola' in branch 'default': |
New changeset 2e6bcbb0ff59 by Giampaolo Rodola' in branch '3.3': |
New changeset 7f0d9637a3ad by Giampaolo Rodola' in branch '3.2': |
New changeset 44d02a5d59fb by Senthil Kumaran in branch '2.7': |
The original problem here was retrieving files failed (hung) when it was tried via context-manager
fobj = urllib.request.urlopen( url ) That indicates the fix in changing something in endtransfer method was improper. I have given more information here: http://bugs.python.org/issue27973#msg286016 The proper fix will be revert the endtransfer changes, but fix it in contextmanager scenario. Add test cases to cover all these scenarios. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: