]> granicus.if.org Git - python/commitdiff
bpo-32793: Fix a duplicate debug message in smtplib (GH-15341)
authorZackery Spytz <zspytz@gmail.com>
Tue, 20 Aug 2019 17:52:25 +0000 (11:52 -0600)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 20 Aug 2019 17:52:25 +0000 (10:52 -0700)
_get_socket() already prints a debug message for the host and port.

https://bugs.python.org/issue32793

Automerge-Triggered-By: @maxking
Lib/smtplib.py
Misc/NEWS.d/next/Library/2019-08-20-05-17-32.bpo-32793.cgpXl6.rst [new file with mode: 0644]

index a634f7ae7336d48125ef94400cbe61ebe8d2ef5a..43a00d9a4e3c42290d7b857cda56c7c9ab361487 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.