]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 87230 via svnmerge from
authorR. David Murray <rdmurray@bitdance.com>
Tue, 14 Dec 2010 14:34:16 +0000 (14:34 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Tue, 14 Dec 2010 14:34:16 +0000 (14:34 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87230 | r.david.murray | 2010-12-14 09:16:20 -0500 (Tue, 14 Dec 2010) | 7 lines

  #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.
........

Lib/telnetlib.py
Misc/NEWS

index 2bfd9cd8ada650705cc2a2a789e4f8b3c4cc6511..bae4ae768df9f70604e00a931c82af955a842d24 100644 (file)
@@ -236,7 +236,7 @@ class Telnet:
 
         """
         if self.debuglevel > 0:
-            print 'Telnet(%s,%d):' % (self.host, self.port),
+            print 'Telnet(%s,%s):' % (self.host, self.port),
             if args:
                 print msg % args
             else:
index 8dbc1f3c74f3c1c4e8833e658cfb932777efdc6e..2d12879e6f0ae181c9961a5b210d95084f904b82 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -18,6 +18,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #10695: passing the port as a string value to telnetlib no longer
+  causes debug mode to fail.
+
 - Issue #10107: Warn about unsaved files in IDLE on OSX.
 
 - Issue #10406: Enable Rstrip IDLE extension on OSX (just like on other