From 2667e966d81d9db3661b9facd8b356ae2b97f920 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 6 May 2026 23:14:14 +0000 Subject: [PATCH] fix(quic-interop): prefer Python <3.14 for the runner venv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pyshark's pcap reader calls asyncio.get_event_loop_policy().get_event_loop(), which raises RuntimeError on Python 3.14 (deprecated in 3.12, removed in 3.14). Symptom: the matrix run completes the actual interop test successfully but the runner's pcap-validation step crashes before it can emit the result, dropping a 100+ line traceback. run-matrix.sh now scans for python3.13 → 3.12 → 3.11 → python3, picking the first that's both installed and < 3.14, and creates the venv with it. Existing venvs created with 3.14 keep working (only matters for fresh clones); for an existing broken venv, rm -rf .venv and re-run. https://claude.ai/code/session_01HcvfQq1ttPV9PkRoJb4nyT --- quic/interop/run-matrix.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/quic/interop/run-matrix.sh b/quic/interop/run-matrix.sh index e336eee3f..83fb00418 100755 --- a/quic/interop/run-matrix.sh +++ b/quic/interop/run-matrix.sh @@ -66,10 +66,26 @@ if [ ! -d "$RUNNER_DIR" ]; then git clone --depth 1 https://github.com/quic-interop/quic-interop-runner.git "$RUNNER_DIR" fi -# 2. venv + Python deps. +# 2. venv + Python deps. Prefer 3.13 — pyshark (the runner's pcap parser) +# trips on 3.14's asyncio.get_event_loop() removal. Fall back to whatever +# `python3` resolves to if 3.13 isn't installed. +PYTHON_BIN="" +for candidate in python3.13 python3.12 python3.11 python3; do + if command -v "$candidate" >/dev/null 2>&1; then + if "$candidate" -c 'import sys; sys.exit(0 if sys.version_info < (3,14) else 1)' 2>/dev/null; then + PYTHON_BIN="$candidate" + break + fi + fi +done +if [ -z "$PYTHON_BIN" ]; then + echo "warning: no Python < 3.14 found; pyshark will likely crash on pcap validation." >&2 + install_hint python3.13 + PYTHON_BIN="python3" +fi if [ ! -d "$RUNNER_DIR/.venv" ]; then - echo "==> creating venv at $RUNNER_DIR/.venv" - python3 -m venv "$RUNNER_DIR/.venv" + echo "==> creating venv at $RUNNER_DIR/.venv (using $PYTHON_BIN)" + "$PYTHON_BIN" -m venv "$RUNNER_DIR/.venv" fi "$RUNNER_DIR/.venv/bin/pip" install -q -r "$RUNNER_DIR/requirements.txt"