What happened?
graphify extract / update / cluster-only / label re-exec themselves via os.execvpe to
pin PYTHONHASHSEED=0 (#3641, #3779) when the caller has not set it. On Windows os.exec* does
not replace the process: CPython starts a new process and the calling one exits. The caller
therefore sees the command finish immediately while the real work continues detached, and in
some runs the process crashes instead.
Steps to reproduce
Repro (Git Bash, any small corpus, `PYTHONHASHSEED` unset):
rm -rf graphify-out
env -u PYTHONHASHSEED python -m graphify extract . --code-only; echo "exit=$?"
ls graphify-out/graph.json
Observed over three runs:
- exit 0 after ~0.5 s, `graph.json` absent on return, appears a few seconds later (the detached
child finished it);
- exit 139 (segmentation fault / access violation), no output (twice).
Error output or graph output
Effect: any script that runs `extract` and then reads `graph.json` (or runs `cluster-only`) fails
intermittently on Windows. Setting `PYTHONHASHSEED=0` before calling graphify avoids the re-exec
and everything works.
Suggested fix: on Windows (`os.name == "nt"`), run the child with
`subprocess.run([sys.executable, "-m", "graphify", *sys.argv[1:]], env=...)` and
`sys.exit(result.returncode)` instead of `os.execvpe`, so the parent waits and propagates the
exit status.
Graphify version
No response
Environment
graphify 0.9.67 (pip graphifyy), Python 3.13.1, Windows 10 (10.0.19045)
Additional context
No response
What happened?
graphify extract/update/cluster-only/labelre-exec themselves viaos.execvpetopin
PYTHONHASHSEED=0(#3641, #3779) when the caller has not set it. On Windowsos.exec*doesnot replace the process: CPython starts a new process and the calling one exits. The caller
therefore sees the command finish immediately while the real work continues detached, and in
some runs the process crashes instead.
Steps to reproduce
Error output or graph output
Graphify version
No response
Environment
graphify 0.9.67 (pip
graphifyy), Python 3.13.1, Windows 10 (10.0.19045)Additional context
No response