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

Dong-hee Na webhook-mailer at python.org
Tue Oct 13 11:19:23 EDT 2020


https://github.com/python/cpython/commit/76b1913daf883b6592815d139f62f3a7fbe3c322
commit: 76b1913daf883b6592815d139f62f3a7fbe3c322
branch: 3.8
author: Dong-hee Na <donghee.na92 at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-10-14T00:18:58+09:00
summary:

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

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

https://bugs.python.org/issue32793

Automerge-Triggered-By: @maxking
(cherry picked from commit 46a7564578f208df1e0c54fc0520d3b7ca32c981)

Co-authored-by: Zackery Spytz <zspytz at gmail.com>

Co-authored-by: Zackery Spytz <zspytz at gmail.com>

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 8e3d4bf0ccf3a..6513842eb6c61 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 0000000000000..f715a816efda9
--- /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