[issue16270] ftplib hangs when closing connection

Giampaolo Rodola' report at bugs.python.org
Thu Oct 18 03:03:59 CEST 2012


Giampaolo Rodola' added the comment:

I can reproduce the issue on python 3.3.
To have a clearer understanding on what's going on use:

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):
http://hg.python.org/cpython/file/f6fcff683866/Lib/urllib/request.py#l2328
Patch in attachment fixes the issue.

----------
keywords: +patch
Added file: http://bugs.python.org/file27606/urllib.patch

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


More information about the Python-bugs-list mailing list