diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-01-26 11:47:43 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-01-26 11:47:43 +0100 |
commit | 0e7103d9e388c684097ea5bc998e598903889ef6 (patch) | |
tree | 0f3c5715dcd5dd55e21abee03a8477a9ad93c367 | |
parent | dae098901104de7027c48dae2b9da08be2a17fac (diff) |
db/message: use DEVNULL stdin when there is no input
Avoid the child grabbing our stdin.
-rw-r--r-- | alot/db/message.py | 3 |
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)) |