This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients neologix, rg3
Date 2011-02-20.20:24:56
SpamBayes Score 9.9177955e-09
Marked as misclassified No
Message-id <1298233497.48.0.540703144285.issue11199@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is due to the way urllib closes a FTP data transfer.
The data channel is closed, and a shutdown hook is called that waits for a message on the control channel. But in that case, when the data connection is closed while the transfer is in progress, the server doesn't send any further message on the control channel, and we remain stuck (note that if the data channel is closed after the file has been transfered, in that case an end of transfer message is sent, which explains why this dones't happen with the sleep in between).
The solution is to first wait for a message on the control channel, and then close the data channel (which makes sense, a close hook is generally called before closing the corresponding connection).
The attached patch just does that.
Note that I'm not sure why we need to wait for a further message on the control channel (maybe it's part of an RFC or something...).
History
Date User Action Args
2011-02-20 20:24:57neologixsetrecipients: + neologix, rg3
2011-02-20 20:24:57neologixsetmessageid: <1298233497.48.0.540703144285.issue11199@psf.upfronthosting.co.za>
2011-02-20 20:24:56neologixlinkissue11199 messages
2011-02-20 20:24:56neologixcreate