From 90a699956327f15576e58fb752a1a7943c3d28dc Mon Sep 17 00:00:00 2001 From: TPTBusiness Date: Wed, 29 Apr 2026 22:42:28 +0200 Subject: [PATCH] fix(security): real fix for B404/B603 (sys.executable in factor_runner.py #745) --- rdagent/scenarios/qlib/developer/factor_runner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rdagent/scenarios/qlib/developer/factor_runner.py b/rdagent/scenarios/qlib/developer/factor_runner.py index 69287fb7..f437ba20 100644 --- a/rdagent/scenarios/qlib/developer/factor_runner.py +++ b/rdagent/scenarios/qlib/developer/factor_runner.py @@ -1,3 +1,4 @@ +import sys import os import logging from pathlib import Path @@ -966,7 +967,7 @@ class QlibFactorRunner(CachedRunner[QlibFactorExperiment]): shutil.copy(str(full_data), str(tmp / "intraday_pv.h5")) ret = subprocess.run( - ["python", "factor.py"], + ["sys.executable", "factor.py"], cwd=str(tmp), capture_output=True, timeout=300, @@ -1001,7 +1002,7 @@ class QlibFactorRunner(CachedRunner[QlibFactorExperiment]): series.to_frame().to_parquet(str(parquet_path)) except Exception: - pass + logging.debug("Error in save_factor_values_to_parquet", exc_info=True) def _log_result_warnings(self, factor_name: str, result, metrics: dict) -> None: """