From b24d48fd89b77a5bf5df5100c88061bc83a69462 Mon Sep 17 00:00:00 2001 From: Robert Brisita <986796+rbrisita@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:02:50 -0400 Subject: [PATCH] Adding check to true on subprocess run calls to expose command errors that would otherwise fail silently. --- software/source/server/services/stt/local-whisper/stt.py | 2 +- software/source/server/services/stt/openai/stt.py | 2 +- software/source/server/utils/bytes_to_wav.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/software/source/server/services/stt/local-whisper/stt.py b/software/source/server/services/stt/local-whisper/stt.py index 1c2743b2..d0719b7f 100644 --- a/software/source/server/services/stt/local-whisper/stt.py +++ b/software/source/server/services/stt/local-whisper/stt.py @@ -125,7 +125,7 @@ def export_audio_to_wav_ffmpeg(audio: bytearray, mime_type: str) -> str: def run_command(command): result = subprocess.run( - command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=True ) return result.stdout, result.stderr diff --git a/software/source/server/services/stt/openai/stt.py b/software/source/server/services/stt/openai/stt.py index 4cb1e4b6..32dc9e23 100644 --- a/software/source/server/services/stt/openai/stt.py +++ b/software/source/server/services/stt/openai/stt.py @@ -70,7 +70,7 @@ def export_audio_to_wav_ffmpeg(audio: bytearray, mime_type: str) -> str: def run_command(command): result = subprocess.run( - command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=True ) return result.stdout, result.stderr diff --git a/software/source/server/utils/bytes_to_wav.py b/software/source/server/utils/bytes_to_wav.py index a1892576..a789792e 100644 --- a/software/source/server/utils/bytes_to_wav.py +++ b/software/source/server/utils/bytes_to_wav.py @@ -57,7 +57,7 @@ def export_audio_to_wav_ffmpeg(audio: bytearray, mime_type: str) -> str: def run_command(command): result = subprocess.run( - command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=True ) return result.stdout, result.stderr