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: Improvements in 'telnetlib'
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: bbrox, loewis
Priority: normal Keywords: patch

Created on 2001-04-14 07:54 by bbrox, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
PATCH bbrox, 2001-04-14 07:54 patch for telnetlib
Messages (3)
msg36354 - (view) Author: Lionel Ulmer (bbrox) Date: 2001-04-14 07:54
This patch does the following :

 - fix the debug string output when receiving telnet
commands (the 'c' was reprinted whereas it's 'opt' that
we want to see on the screen)

 - added all the telnet options known to arpa/telnet.h

 - added the possibility for the user to have it's own
option negotiation callback, thus overriding Python's
default WILL/WONT => DONT, DO/DONT => WONT behaviour

Now, on a design perspective, I did not know what was
best : do as I did or add a __default_callback function
in the telnetlib file that would do the default
behavious and thus preventing the 'if callback:' tests.
msg36355 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2001-07-28 11:38
Logged In: YES 
user_id=21627

The patch looks good, but I'd like you to improve 
standards conformance of the telnet options. I.e. you 
should document which version of arpa/telnet.h you've used 
as a basis. In addition, you should consider adding telnet 
options not listed in this file.

In the past, they were all collected in an RFC; the last 
one who did this was RFC 2400. Now, IANA has a separate 
table, http://www.iana.org/assignments/telnet-options.

I recommend that you add all those constants in addition 
to their telnet.h names, e.g. TOPT_XDL, TOPT_3270, 
TOPT_X_3.

As for the callback design: Another option would be to 
allow subclassing the telnet class, e.g. a self.do_option 
method. I'm not sure what it best here, your current 
approach seems fine.

Please also try to draft a patch for 
Doc/lib/libtelnetlib.tex. At a minimum, this should 
document the callback and the existence of the constants; 
if possible, it should give an example of option 
negotiation.

msg36356 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2001-09-06 08:54
Logged In: YES 
user_id=21627

Thanks for the patch. I've added the additional
IANA-registered options; if there is any interest,
suboptions may be added to the module as well.

Committed as telnetlib.py 1.15, libtelnetlib.tex 1.8, NEWS
1.234.
History
Date User Action Args
2022-04-10 16:03:57adminsetgithub: 34325
2001-04-14 07:54:34bbroxcreate