Author ckreddy
Recipients ckreddy
Date 2018-06-08.12:16:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1528460164.81.0.592728768989.issue33806@psf.upfronthosting.co.za>
In-reply-to
Content
i see from the below link it says "cannot re-open an already existing telnet instance" using Telnetlib. Can this be fixed in the later versions of python or is there any work around for this. 

I'm surprised that this is something which PERL supports and not python .

When I try to open a new session which is already opened the telnet server asks whether to open in a.read only or b.read/write mode and when i try to write 'a' it doesn't take and program fails.

my code:
tn = telnetlib.Telnet(HOST,PORT)
print("established connection")
print(tn.read_until(">> ".encode('ascii')))
tn.write(("a".encode('ascii')))

output:
established connection
b'\r\n a. Connect to Port read/write\r\n b. Connect to Port read only\r\n c. Do not connect, drop this connection request\r\n d. Look at port log file\r\n>> '
History
Date User Action Args
2018-06-08 12:16:04ckreddysetrecipients: + ckreddy
2018-06-08 12:16:04ckreddysetmessageid: <1528460164.81.0.592728768989.issue33806@psf.upfronthosting.co.za>
2018-06-08 12:16:04ckreddylinkissue33806 messages
2018-06-08 12:16:04ckreddycreate