diff options
| author | Barry Warsaw | 2017-06-16 04:34:10 +0000 |
|---|---|---|
| committer | Barry Warsaw | 2017-06-16 04:34:10 +0000 |
| commit | 4fdad6f9c8a9487a6f2c8462be734cd97aaf4d94 (patch) | |
| tree | 7e7690586846d5a4d62040d6433ac6fc7562f77a /src/mailman/handlers/mime_delete.py | |
| parent | ccde15919fe89cd47d9f57d79d3450eb85253fcb (diff) | |
| parent | 249f47b3c947c4a64c5d0cca949e70f20a4d3644 (diff) | |
| download | mailman-4fdad6f9c8a9487a6f2c8462be734cd97aaf4d94.tar.gz mailman-4fdad6f9c8a9487a6f2c8462be734cd97aaf4d94.tar.zst mailman-4fdad6f9c8a9487a6f2c8462be734cd97aaf4d94.zip | |
Diffstat (limited to 'src/mailman/handlers/mime_delete.py')
| -rw-r--r-- | src/mailman/handlers/mime_delete.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mailman/handlers/mime_delete.py b/src/mailman/handlers/mime_delete.py index 14aee1a0e..662c773ae 100644 --- a/src/mailman/handlers/mime_delete.py +++ b/src/mailman/handlers/mime_delete.py @@ -28,7 +28,6 @@ import os import shutil import logging import tempfile -import subprocess from contextlib import ExitStack, suppress from email.iterators import typed_subpart_iterator @@ -46,6 +45,7 @@ from mailman.utilities.string import oneline from mailman.version import VERSION from public import public from string import Template +from subprocess import CalledProcessError, check_output from zope.interface import implementer @@ -277,9 +277,8 @@ def to_plaintext(msg): template = Template(config.mailman.html_to_plain_text_command) command = template.safe_substitute(filename=filename).split() try: - stdout = subprocess.check_output( - command, universal_newlines=True) - except subprocess.CalledProcessError: + stdout = check_output(command, universal_newlines=True) + except (CalledProcessError, FileNotFoundError, PermissionError): log.exception('HTML -> text/plain command error') else: # Replace the payload of the subpart with the converted text |
