Convert message string to bytes for sendmail.
authorW. Trevor King <wking@tremily.us>
Fri, 5 Oct 2012 01:45:52 +0000 (21:45 -0400)
committerW. Trevor King <wking@tremily.us>
Fri, 5 Oct 2012 01:45:52 +0000 (21:45 -0400)
rss2email.py

index 2e76e248f89d4f3256416c15169ad16627695bef..7a94c5f3d1c54b66b3a28dad09111ce626fe0cb2 100755 (executable)
@@ -500,7 +500,7 @@ def sendmail_send(sender, recipient, message, config=None, section='DEFAULT'):
             ['/usr/sbin/sendmail', recipient],
             stdin=_subprocess.PIPE, stdout=_subprocess.PIPE,
             stderr=_subprocess.PIPE)
-        stdout,stderr = p.communicate(message.as_string())
+        stdout,stderr = p.communicate(message.as_string().encode('ascii'))
         status = p.wait()
         if status:
             raise SendmailError(status=status, stdout=stdout, stderr=stderr)