]> granicus.if.org Git - python/commitdiff
#16914: fix test errors under -W error::BytesWarning.
authorR David Murray <rdmurray@bitdance.com>
Thu, 16 Apr 2015 22:54:56 +0000 (18:54 -0400)
committerR David Murray <rdmurray@bitdance.com>
Thu, 16 Apr 2015 22:54:56 +0000 (18:54 -0400)
There are doubtless other debug messages in smtplib that would trigger an
error if they were tested, but this fixes the things we do now test,
which is good enough for now.

Lib/smtplib.py

index c559a4ca68856ed5eb792501cac7348fd5def498..7f49f2397c66db055e8fadf2db0e82eb955e384c 100755 (executable)
@@ -328,7 +328,7 @@ class SMTP:
         self.file = None
         (code, msg) = self.getreply()
         if self.debuglevel > 0:
-            self._print_debug('connect:', msg)
+            self._print_debug('connect:', repr(msg))
         return (code, msg)
 
     def send(self, s):
@@ -400,7 +400,7 @@ class SMTP:
 
         errmsg = b"\n".join(resp)
         if self.debuglevel > 0:
-            self._print_debug('reply: retcode (%s); Msg: %s' % (errcode, errmsg))
+            self._print_debug('reply: retcode (%s); Msg: %a' % (errcode, errmsg))
         return errcode, errmsg
 
     def docmd(self, cmd, args=""):