New submission from Christian S. Perone <christian.per...@gmail.com>:

When you use telnetlib with a "str" parameter as Port Number:
tel = telnetlib.Telnet("10.0.2.9", "8123")
tel.read_until("login: ")

It works fine, except if you set the debuglevel:
tel.set_debuglevel(30)

Then the follow exception is thrown:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python26\lib\telnetlib.py", line 306, in read_until
    self.fill_rawq()
  File "c:\python26\lib\telnetlib.py", line 517, in fill_rawq
    self.msg("recv %r", buf)
  File "c:\python26\lib\telnetlib.py", line 239, in msg
    print 'Telnet(%s,%d):' % (self.host, self.port),
TypeError: %d format: a number is required, not str

I think that the string "Telnet(%s,%d):" on the telnetlib.py should be 
"Telnet(%s,%s):", since it works fine with a str as Port Number.

----------
components: Library (Lib)
messages: 123894
nosy: Christian.S..Perone
priority: normal
severity: normal
status: open
title: telnetlib.Telnet port number int/str inconsistency
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10695>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to