summaryrefslogtreecommitdiff
path: root/alot/db
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-26 11:47:43 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-26 11:47:43 +0100
commit0e7103d9e388c684097ea5bc998e598903889ef6 (patch)
tree0f3c5715dcd5dd55e21abee03a8477a9ad93c367 /alot/db
parentdae098901104de7027c48dae2b9da08be2a17fac (diff)
db/message: use DEVNULL stdin when there is no input
Avoid the child grabbing our stdin.
Diffstat (limited to 'alot/db')
-rw-r--r--alot/db/message.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/alot/db/message.py b/alot/db/message.py
index e10e29a5..8ca8f2b3 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -43,7 +43,8 @@ def _render_part_external(payload, ctype, params, filename):
try:
result = subprocess.run(h.cmd, shell = True, check = True,
- capture_output = True, input = h.stdin)
+ capture_output = True, input = h.stdin,
+ stdin = None if h.stdin else subprocess.DEVNULL)
except subprocess.CalledProcessError as e:
logging.error('Calling mailcap handler "%s" failed with code %d: %s',
h.cmd, e.returncode, decode(e.stderr))