From 81a2b639f581a9521aef7d26e27e330d4f844758 Mon Sep 17 00:00:00 2001 From: rldyourmnd Date: Sun, 4 Oct 2026 08:18:42 +0500 Subject: [PATCH] fix(scripts): resolve the interpreter before building .venv 'uv python find' may answer a symlink (for example a ~/.local/bin shim into an extracted toolchain). A --copies venv records that link's directory as home, so the copied binary resolves /../lib and loses its stdlib: ensurepip dies with 'no module named encodings' and the module-pin verification lane cannot build the environment. Resolve the real path first; on a real interpreter the call is a no-op. Signed-off-by: rldyourmnd --- scripts/validate_module.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/validate_module.sh b/scripts/validate_module.sh index e0bad82..7d8e1ee 100755 --- a/scripts/validate_module.sh +++ b/scripts/validate_module.sh @@ -39,6 +39,9 @@ fi cd "$ROOT" if [ ! -e "$PYTHON_ENV" ]; then python_binary=$("$uv_binary" python find 3.13.14) + # A symlinked interpreter records the link's directory as the venv `home`, + # so a --copies binary resolves prefix/../lib there and loses its stdlib. + python_binary=$("$python_binary" -c 'import os,sys; print(os.path.realpath(sys.executable))') "$python_binary" -I -B -m venv --copies "$PYTHON_ENV" PYTHON_ENV_OWNED=1 fi