From 735f125d9c8e03611e1f0e8f9df4b4f9c4f8b959 Mon Sep 17 00:00:00 2001 From: Io Mintz Date: Wed, 29 Apr 2020 23:55:31 +0000 Subject: [PATCH] utils.image: stop shitting up /tmp --- utils/image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/image.py b/utils/image.py index af845c5..5f98ae3 100755 --- a/utils/image.py +++ b/utils/image.py @@ -7,6 +7,7 @@ import contextlib import functools import io import logging +import signal import sys import typing @@ -122,7 +123,7 @@ async def process_image_in_subprocess(command_name, image_data: bytes): try: image_data, err = await asyncio.wait_for(proc.communicate(image_data), timeout=float('inf')) except asyncio.TimeoutError: - proc.kill() + proc.send_signal(signal.SIGINT) raise errors.ImageResizeTimeoutError if command_name == 'resize' else errors.ImageConversionTimeoutError else: if proc.returncode == 2: