From 29894813fbdec576a3692e980c2a3e839cb8b500 Mon Sep 17 00:00:00 2001 From: Sungsu Lim Date: Mon, 7 Aug 2017 08:34:47 -0700 Subject: [PATCH 1/2] fix disk leakage where tmpfile was not being deleted properly when it crashed --- pydub/audio_segment.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pydub/audio_segment.py b/pydub/audio_segment.py index 5d497b98..0b54b568 100644 --- a/pydub/audio_segment.py +++ b/pydub/audio_segment.py @@ -508,12 +508,13 @@ def is_format(f): if p.returncode != 0: raise CouldntDecodeError("Decoding failed. ffmpeg returned error code: {0}\n\nOutput from ffmpeg/avlib:\n\n{1}".format(p.returncode, p_err)) - obj = cls._from_safe_wav(output) - - input_file.close() - output.close() - os.unlink(input_file.name) - os.unlink(output.name) + try: + obj = cls._from_safe_wav(output) + finally: + input_file.close() + output.close() + os.unlink(input_file.name) + os.unlink(output.name) return obj From 57bc79e2def9bcc7b2ef0e5b2896687eedd92dc4 Mon Sep 17 00:00:00 2001 From: Sungsu Lim Date: Mon, 7 Aug 2017 13:52:02 -0700 Subject: [PATCH 2/2] added AUTHORS --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index cc4315aa..2ee3a2f4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -63,3 +63,6 @@ Mike Mattozzi Marcio Mazza github: marciomazza + +Sungsu Lim + github: proflim