From 25f4126d1162710a4f49e7734a6fa8598f2567d4 Mon Sep 17 00:00:00 2001 From: "duncan.macleod" Date: Fri, 27 Oct 2023 13:38:27 +0100 Subject: [PATCH] omicron.utils: set OMICRON_HTML in get_omicron_version avoids https://git.ligo.org/virgo/virgoapp/Omicron/-/issues/81 --- omicron/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/omicron/utils.py b/omicron/utils.py index 12a44f1..39562ab 100644 --- a/omicron/utils.py +++ b/omicron/utils.py @@ -24,6 +24,7 @@ import sys from pathlib import Path from shutil import which +from tempfile import gettempdir from packaging.version import Version @@ -98,10 +99,10 @@ def get_omicron_version(executable=None): executable = executable or find_omicron() try: return Version( - subprocess.check_output([ - executable, - "version", - ]).decode("utf-8").rsplit(maxsplit=1)[-1], + subprocess.check_output( + [executable, "version"], + env={"OMICRON_HTML": gettempdir()}, + ).decode("utf-8").rsplit(maxsplit=1)[-1], ) except subprocess.CalledProcessError as ex: raise RuntimeError(f"failed to determine omicron version from executable: {str(ex)}")