Email debug mode on Python 3 was printing bytestring representation for subject body
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 25 Feb 2016 23:38:28 +0000 (15:38 -0800)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 25 Feb 2016 23:38:28 +0000 (15:38 -0800)
There's nothing useful about seeing b'foo\nbar\nbaz' printing to
stdout.  That's not what the user should get!

mediagoblin/tools/mail.py

index ab3e0eaa374d598a886fe38cdcee99d0ab64bfc5..74e59fb3792a21a636eeac33bc9a90bfe4f6396d 100644 (file)
@@ -137,7 +137,7 @@ def send_email(from_addr, to_addrs, subject, message_body):
         print("To addresses: %s" % message['To'])
         print("Subject: %s" % message['Subject'])
         print("-- Body: --")
-        print(message.get_payload(decode=True))
+        print(message_body)
 
     return mhost.sendmail(from_addr, to_addrs, message.as_string())