fix(retrieval): keep multi-word arguments on Windows

os.execv does not quote arguments on Windows, so the hand-off to the virtual
environment split every multi-word --query and search always failed. Run the
runtime with subprocess on Windows instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian lechnerandClaude Opus 5.5 committed 2026-10-01 13:13:02 +02:00
1 parent 83e921301b
commit 4e4a10604d
2 files changed
+13 -2

No files matched your search

+6 -2
View File
@@ -56,10 +56,14 @@ def runtime_python(script=__file__, executable=sys.executable, system=os.name):
return None
def use_runtime_python():
def use_runtime_python(system=os.name):
runtime = runtime_python()
if runtime is not None:
os.execv(str(runtime), [str(runtime), str(Path(__file__).resolve()), *sys.argv[1:]])
command = [str(runtime), str(Path(__file__).resolve()), *sys.argv[1:]]
if system == 'nt':
# os.execv does not quote arguments on Windows, so a multi-word --query would be split.
sys.exit(subprocess.run(command).returncode)
os.execv(command[0], command)
def sections(text: str, path: str):