#10695: use %s not %d so that a string 'port' does not cause a debug traceback
Passing the port as a string value works fine in regular mode, but
if you turned debug on it would throw an error trying to print the
port number, which is surprising and confusing.
diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py
index c60578d..82b5e8f 100644
--- a/Lib/telnetlib.py
+++ b/Lib/telnetlib.py
@@ -236,7 +236,7 @@
"""
if self.debuglevel > 0:
- print('Telnet(%s,%d):' % (self.host, self.port), end=' ')
+ print('Telnet(%s,%s):' % (self.host, self.port), end=' ')
if args:
print(msg % args)
else: