[Python-checkins] bpo-32793: Fix a duplicate debug message in smtplib (GH-15341)

Miss Islington (bot) webhook-mailer at python.org
Tue Aug 20 13:52:38 EDT 2019


https://github.com/python/cpython/commit/46a7564578f208df1e0c54fc0520d3b7ca32c981
commit: 46a7564578f208df1e0c54fc0520d3b7ca32c981
branch: master
author: Zackery Spytz <zspytz at gmail.com>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2019-08-20T10:52:25-07:00
summary:

bpo-32793: Fix a duplicate debug message in smtplib (GH-15341)



_get_socket() already prints a debug message for the host and port.



https://bugs.python.org/issue32793



Automerge-Triggered-By: @maxking

files:
A Misc/NEWS.d/next/Library/2019-08-20-05-17-32.bpo-32793.cgpXl6.rst
M Lib/smtplib.py

diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index a634f7ae7336..43a00d9a4e3c 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -333,8 +333,6 @@ def connect(self, host='localhost', port=0, source_address=None):
                     raise OSError("nonnumeric port")
         if not port:
             port = self.default_port
-        if self.debuglevel > 0:
-            self._print_debug('connect:', (host, port))
         sys.audit("smtplib.connect", self, host, port)
         self.sock = self._get_socket(host, port, self.timeout)
         self.file = None
diff --git a/Misc/NEWS.d/next/Library/2019-08-20-05-17-32.bpo-32793.cgpXl6.rst b/Misc/NEWS.d/next/Library/2019-08-20-05-17-32.bpo-32793.cgpXl6.rst
new file mode 100644
index 000000000000..f715a816efda
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-08-20-05-17-32.bpo-32793.cgpXl6.rst
@@ -0,0 +1 @@
+Fix a duplicated debug message when :meth:`smtplib.SMTP.connect` is called.



More information about the Python-checkins mailing list