telnetlib/socket NT to unix

Tim Roberts timr at probo.com
Mon May 20 02:38:22 EDT 2002


cdelarue at bigfoot.com (Christophe Delarue) wrote:

>I am trying to use the telnetlib to connect onto a sun machine :
>import telnetlib
>t = telnetlib.Telnet()
>t.open("134.64.118.175",23)
>-> time out occurs ! at the self.sock.connect((host,port))
>
>I tried it through a normal telnet :
>
>If I send a Start->run->telnet, ask a connection to the same host, the
>connection is ok.
>
>Is there anybody have a solution to my pb ?
> 
>I'am under NT4.0 and python2.1

There is a bug in the NT 4.0 implementation of gethostbyname that prevents
it from correctly translating a numeric IP address specified as a string.

If the machine has a name, use the name.  If not, add a fake name in
\winnt\system32\drivers\etc\hosts:

    134.64.118.175      sunxxx1

Then use this:
  t.open("sunxxx1",23)

Alternatively, you could upgrade to Windows 2000.  It is much better.
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list