[Tutor] What is the use of voidresp()?

william chimera4@fastmail.fm
Thu Feb 13 08:37:06 2003


Hi,
I am currently trying to do an app that accesses ftp servers and
downloads parts of a file. I have a function that does basically what
ftplib.retrbinary() does, but it breaks the connection when the required
segment has been downloaded. I am basing my function on retrbinary code,
but I am puzzled as to what voidresp() does at the end of the retrbinary
function. From what I can gather, it merely checks server response. But
why do we need to do that at the end of the connection? 
Anyway, I found out an exception will be raised, because the server
responded with error 451 which is 'Transfer aborted. Broken pipe' Which
is not an error for me because I wanted to abort the transfer. So should
I just leave out the voidresp() check, or should I just use a try-except
block to handle the exception and check whether its 451, and if not,
reraise the exception? By the way, are there any other conditions which
might lead to error 451 that I should be concerned with?
Thanks in advance.

-- 
http://fastmail.fm - Choose from over 50 domains or use your own