From 9b187140ff2fe9da044208c0fc6299c13c4eb3d4 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 27 Jul 2020 21:18:24 +0200 Subject: [PATCH] catch exception and replace with a debug message, refs #22 --- owrx/audio.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/owrx/audio.py b/owrx/audio.py index b77ad7c..76505bf 100644 --- a/owrx/audio.py +++ b/owrx/audio.py @@ -183,9 +183,14 @@ class AudioWriter(object): stdout=subprocess.PIPE, cwd=self.tmp_dir, close_fds=True, - ) - for line in decoder.stdout: - self.outputWriter.send((job.freq, line)) + ) + try: + for line in decoder.stdout: + self.outputWriter.send((job.freq, line)) + except OSError: + decoder.stdout.flush() + # TODO uncouple parsing from the output so that decodes can still go to the map and the spotters + logger.debug("output has gone away while decoding job.") try: rc = decoder.wait(timeout=10) if rc != 0: