From 952736c1270f3c538343f6fe57271d7d659f003b Mon Sep 17 00:00:00 2001 From: Smittix Date: Fri, 27 Feb 2026 11:15:50 +0000 Subject: [PATCH] fix: set cwd for radiosonde subprocess so autorx package imports resolve Co-Authored-By: Claude Opus 4.6 --- routes/radiosonde.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routes/radiosonde.py b/routes/radiosonde.py index 2fb1ae0..f95698e 100644 --- a/routes/radiosonde.py +++ b/routes/radiosonde.py @@ -420,6 +420,9 @@ def start_radiosonde(): else: cmd = [auto_rx_path, '-c', cfg_dir] + # Set cwd to the auto_rx directory so 'from autorx.scan import ...' works + auto_rx_dir = os.path.dirname(os.path.abspath(auto_rx_path)) + try: logger.info(f"Starting radiosonde_auto_rx: {' '.join(cmd)}") app_module.radiosonde_process = subprocess.Popen( @@ -427,6 +430,7 @@ def start_radiosonde(): stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, start_new_session=True, + cwd=auto_rx_dir, ) # Wait briefly for process to start