[tor-commits] [doctor/master] Including stdin pipe for mail command

atagar at torproject.org atagar at torproject.org
Mon Sep 16 19:22:14 UTC 2013


commit 3877bddea9146252927e87abf353b79e16debe0b
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Sep 16 12:27:05 2013 -0700

    Including stdin pipe for mail command
    
    Missing ingredient. Without this the communicate() method just hangs without
    sending anything to stdin.
---
 util.py |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/util.py b/util.py
index 32e795e..7dd81fc 100644
--- a/util.py
+++ b/util.py
@@ -90,7 +90,13 @@ def send(subject, body_text = None, destination = TO_ADDRESS):
   :raises: **Exception** if the email fails to be sent
   """
 
-  process = subprocess.Popen(['mail', '-E', '-s', subject, destination], stdout = subprocess.PIPE, stderr = subprocess.PIPE)
+  process = subprocess.Popen(
+    ['mail', '-E', '-s', subject, destination],
+    stdout = subprocess.PIPE,
+    stdout = subprocess.PIPE,
+    stderr = subprocess.PIPE,
+  )
+
   stdout, stderr = process.communicate(body_text)
   exit_code = process.poll()
 



More information about the tor-commits mailing list