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: Strict RFC 959 (telnet in command channel)
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: giampaolo.rodola, ods, phd
Priority: normal Keywords: patch

Created on 2003-10-11 18:04 by phd, last changed 2022-04-10 16:11 by admin.

Files
File name Uploaded Description Edit
ftplib.py.patch phd, 2003-10-11 18:04 The patch for ftplib.py to implement telnet option
ftplib.py.patch2 phd, 2004-10-21 09:52 This is another solution to the same problem. Instead of patching FTP class the patch creates TelnetFTP subclass.
Messages (4)
msg44756 - (view) Author: Oleg Broytman (phd) * Date: 2003-10-11 18:04
RFC 959 *requires* to implemet a portion of the telnet
protocol in the command channel. Without this ftlib has
problems interacting with RFC959-compliant server (most
Unix ftp daemons are compliant) if, e.g., a directory
or a filename contains russian characters.

The attched patch implements a minimal requirement (it
doubles chr(255) in the .putline() method), but it
allows a programer to choose if a session will be
strict or not. Default value is "not strict" because
most clients (even Unix clients) do not implemet this
telnet option, and most Windoze servers do not implemet it.

Tested with ProFTPd on GNU/Linux system.
msg84537 - (view) Author: Oleg Broytman (phd) * Date: 2009-03-30 11:53
Since I've created the issue I found there are different servers even in
Unix. ProFTPd (and, I believe wu-ftpd) strictly implement
telnet-in-command channel, they even don't have an option to turn it
off. PureFTPd doesn't implement it.

On the client side - lftp (command line client) and squid (well-known
web/ftp proxy) implement telnet-in-command channel.
msg114127 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2010-08-17 15:06
Other than IAC what other chars need to be doubled?
As an alternative to a brand new TelnetFTP class this can be implemented as a FTP class attribute ("strict_telnet" maybe) defaulting to True.
msg114133 - (view) Author: Oleg Broytman (phd) * Date: 2010-08-17 16:20
> Other than IAC what other chars need to be doubled?

Only IAC must be doubled. Also there have to be a special prefix for urgent (out-of-bound) commands (ABORt); I didn't implement that.

> As an alternative to a brand new TelnetFTP class this can be implemented as a FTP class attribute ("strict_telnet" maybe) defaulting to True.

See the first patch. Default value is False to preserve backward compatibility.
History
Date User Action Args
2022-04-10 16:11:41adminsetgithub: 39394
2013-05-26 00:59:29BreamoreBoysetversions: + Python 2.7, Python 3.3, Python 3.4, - Python 2.6, Python 3.1
2010-08-24 22:22:15eric.araujolinkissue1576598 superseder
2010-08-24 22:19:52BreamoreBoyunlinkissue1576598 dependencies
2010-08-17 16:20:37phdsetmessages: + msg114133
2010-08-17 15:06:20giampaolo.rodolasetmessages: + msg114127
2009-05-12 17:04:25ajaksu2linkissue1576598 dependencies
2009-05-12 17:03:44ajaksu2setstage: test needed
type: behavior
versions: + Python 2.6, Python 3.1, - Python 2.4
2009-03-30 11:53:49phdsetnosy: + ods
messages: + msg84537
2008-09-22 00:11:32giampaolo.rodolasetnosy: + giampaolo.rodola
2003-10-11 18:04:55phdcreate