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.

classification
Title: ftplib transfer problem with certain servers
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: customdesigned, loewis
Priority: normal Keywords: patch

Created on 2005-11-17 19:14 by customdesigned, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ftplib.patch customdesigned, 2005-11-17 19:14 Handle 2xx before 1xx
Messages (3)
msg49051 - (view) Author: Stuart D. Gathman (customdesigned) Date: 2005-11-17 19:14
Gets error_reply exception: 200 Command Ok
Some ftp servers return a 2xx response before returning a
1xx response to begin transfer. I don't know whether
such servers are in error.  The C ftp client
(netkit-ftp-0.17) handles this case.  
msg49052 - (view) Author: Stuart D. Gathman (customdesigned) Date: 2005-11-19 05:45
Logged In: YES 
user_id=142072

Examples of patch in action, list command:
*cmd* 'PASV'
*put* 'PASV\r\n'
*get* '227 Entering Passive Mode (204,90,130,189,158,118)\r\n'
*resp* '227 Entering Passive Mode (204,90,130,189,158,118)'
*cmd* 'LIST'
*put* 'LIST\r\n'
*get* '200 Command Okay.\r\n'
*resp* '200 Command Okay.'
*get* '150 Opening data connection for transfer.\r\n'
*resp* '150 Opening data connection for transfer.'
*get* '226-Closing data connection - action successful.\r\n'
*get* '\tList command OK, SNRF: 051118183485S0\r\n'
*get* '226 \r\n'
*resp* '226-Closing data connection - action
successful.\n\tList command OK, SNRF: 051118183485S0\n226 '

Store command:
*cmd* 'PASV'
*put* 'PASV\r\n'
*get* '227 Entering Passive Mode (204,90,130,189,138,35)\r\n'
*resp* '227 Entering Passive Mode (204,90,130,189,138,35)'
*cmd* 'STOR /bms/edi/send/051118.dat'
*put* 'STOR /bms/edi/send/051118.dat\r\n'
*get* '200 Command Okay.\r\n'
*resp* '200 Command Okay.'
*get* '150 Opening data connection for transfer.\r\n'
*resp* '150 Opening data connection for transfer.'
*get* '226-Closing data connection - action successful.\r\n'
msg49053 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-11-12 18:49
Logged In: YES 
user_id=21627

Thanks for the patch. Committed (with modificiations) as
r52739 and r52740.
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42604
2005-11-17 19:14:31customdesignedcreate