aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-07-17 21:48:17 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-07-17 21:48:17 +0200
commit2f29390fb8e395fd836e34324d51d2256e33b195 (patch)
tree281ac0e4b3e16ed04b69f0094b1fee2db4f9e269
parent856162796e08fadd783accf3252b378254908819 (diff)
downloadquiz-2f29390fb8e395fd836e34324d51d2256e33b195.tar.gz
quiz-2f29390fb8e395fd836e34324d51d2256e33b195.zip
quote file names to support paths with spaces
-rwxr-xr-xquiz.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/quiz.py b/quiz.py
index ad95f45..45af0c4 100755
--- a/quiz.py
+++ b/quiz.py
@@ -43,7 +43,7 @@ def err(msg: str, status=1):
def play_sound(sound: Path):
"""Play a sound file"""
- subprocess.run(f'{PLAY_SOUND_CMD} {sound}'.split(),
+ subprocess.run(f'{PLAY_SOUND_CMD} "{sound}"'.split(),
check=True,
stderr=subprocess.DEVNULL,
stdout=subprocess.DEVNULL)
@@ -147,7 +147,7 @@ def load_solutions(question_dirs: list[Path],
def show_question(question: Path) -> subprocess.Popen:
"""show the question in an external programm and return the process"""
- cmd = f'{SHOW_QUESTION_CMD} {question}'.split()
+ cmd = f'{SHOW_QUESTION_CMD} "{question}"'.split()
return subprocess.Popen(cmd)