]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.8] bpo-32793: Fix a duplicate debug message in smtplib (GH-15341) (GH-22683)
authorDong-hee Na <donghee.na92@gmail.com>
Tue, 13 Oct 2020 15:18:58 +0000 (00:18 +0900)
committerGitHub <noreply@github.com>
Tue, 13 Oct 2020 15:18:58 +0000 (00:18 +0900)
_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@gmail.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Lib/smtplib.py
Misc/NEWS.d/next/Library/2019-08-20-05-17-32.bpo-32793.cgpXl6.rst [new file with mode: 0644]

index 8e3d4bf0ccf3ae793f28253cda1d4a29f933a0ef..6513842eb6c6127b4cc1b5c0d9839763e964d4a3 100755 (executable)
@@ -333,8 +333,6 @@ class SMTP:
                     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 (file)
index 0000000..f715a81
--- /dev/null
@@ -0,0 +1 @@
+Fix a duplicated debug message when :meth:`smtplib.SMTP.connect` is called.