ftplib problem/question

stale at siteloft.com stale at siteloft.com
Wed Jan 24 05:17:16 EST 2001


I am writing a small ftp client and have some problems/questionsabout ftplib.
When i store files on a server and try to send an abort command,
i get a socket error, but when i retrieve a file from a ftp server i have no
problems. I have written a method which is identical to the 
ftplib.FTP.abort method, but it sends a STAT command, the same 
problem occures. Although i get abort/stat successful response, the 
ftp object locks in some way. I can still send certain commands like 
pwd/cwd/pasv, but no commands where we need to send data over 
the socket like LIST/RETR/STOR. I get two different Socket errors 
when sending a STAT or ABORT command during STOR: 
104, Connection reset by peer.  32, Broken pipe

Does anyone know how to avoid these errors, or how to deal with them ?
Thanks in advance.

Ståle P.

Log of a abort command during file transfer:
*cmd* 'TYPE I'
*put* 'TYPE I\015\012'
*get* '200 Type set to I.\015\012'
*resp* '200 Type set to I.'
*cmd* 'PASV'
*put* 'PASV\015\012'
*get* '227 Entering Passive Mode (*,*,*,*,*,*)\015\012'
*resp* '227 Entering Passive Mode (*,*,*,*,*,*)'
*cmd* 'STOR beopen-python-2.0.tar.gz'
*put* 'STOR beopen-python-2.0.tar.gz\015\012'
*get* '150 Opening BINARY mode data connection for beopen-python-2.0.tar.gz.\015\012'
*resp* '150 Opening BINARY mode data connection for beopen-python-2.0.tar.gz.'
*put urgent* 'ABOR\015\012'
*get* '426 Transfer aborted. Data connection closed.\015\012'

Error from ftplib.all_errors in storebinary (32, 'Broken pipe')
*get* '226 Abort successful\015\012'
*resp* '226 Abort successful'



More information about the Python-list mailing list