Telnet connection

Bengt Richter bokr at oz.net
Fri Mar 1 05:49:00 EST 2002


On 28 Feb 2002 23:46:47 GMT, bokr at oz.net (Bengt Richter) wrote:

>On Thu, 28 Feb 2002 19:51:06 +0100, "Riss Nicolas" <alien275 at libertysurf.fr> wrote:
>
>>Has somebody a python program where it is an telnet connection ?
>
>You appear to be running windows. What happens if you get into your browser
>and put
>
>    telnet://192.168.0.9:32
>
>in the location (i.e., what you are trying to connect to with your code)?
>Do you get a telnet client screen with a login prompt?
>
>Did you try \r\n in place of plain \n in your code?
>

Whoa, I just realized your program seems to be missing
a couple of lines for waiting for a user prompt and sending
the user name.

After that, wait for the password prompt. At least
that is typical. Or do you have some special telnet server
setup that bypasses that? Maybe it still needs a \r\n to
trigger it past the missing user entry? It's hard to say
with so little info.

Or copy from the screen of a manual login and successful
connect with a couple commands. (Do you connect to an ordinary
shell or some special program)?

BTW, if you somehow have wrapped your telnet program execution
in a try: do_it() except: pass, you could be missing a bug-caused
exception discussed in another thread. You might want to try
changing line 424 of telnetlib.py. In the other thread I wrote:

I suspect line 424
    self.msg('IAC %d not recognized' % ord(opt))
should be
    self.msg('IAC %d not recognized' % ord(c))

Regards,
Bengt Richter
PS., explain in French if that helps. Someone will translate if needed.
Maybe even if not needed ;-)




More information about the Python-list mailing list