Re: Unable to abort a FTP command?

2009-04-15 Thread Scott David Daniels
_...@163.com wrote: Thank you. You are right, retrbinary did not notice I want to abort, so it won't break the recv loop and close data connection def getpart(self, ftp_filename, rest, cnt, out_filename): self.outf = open(out_filename, 'wb') self.cnt = cnt

Unable to abort a FTP command?

2007-07-25 Thread _wdx
Hi, I write the following script to retrieve a part of a large file from a FTP site: import ftplib class ftp_getter(object): def __init__(self): self.handle = ftplib.FTP('ftp_server_address') self.handle.set_debuglevel(2) self.login() def login(self):

Re: Unable to abort a FTP command?

2007-07-25 Thread billiejoex
On 25 Lug, 09:48, [EMAIL PROTECTED] wrote: Hi, I write the following script to retrieve a part of a large file from a FTP site: import ftplib class ftp_getter(object): def __init__(self): self.handle = ftplib.FTP('ftp_server_address')

Re: Unable to abort a FTP command?

2007-07-25 Thread _wdx
Thank you. You are right, retrbinary did not notice I want to abort, so it won't break the recv loop and close data connection. I changed getpart and callback like this, now it works: def getpart_callback(self, received): print received a packet if self.cnt = 0: