From 0e7103d9e388c684097ea5bc998e598903889ef6 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 26 Jan 2021 11:47:43 +0100 Subject: db/message: use DEVNULL stdin when there is no input Avoid the child grabbing our stdin. --- alot/db/message.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'alot/db') 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)) -- cgit v1.2.3