{"record":{"id":"9e72128f4eeb2682","repo":"nexu-io/open-design","slug":"last30days-v3-requires-python-3-12-detected-pyth","errorCode":null,"errorMessage":"last30days v3 requires Python 3.12+.\nDetected Python {major}.{minor}.{micro}.\nInstall and use python3.12 or python3.13, then rerun this command.","messagePattern":"last30days v3 requires Python 3\\.12\\+\\.\nDetected Python (.+?)\\.(.+?)\\.(.+?)\\.\nInstall and use python3\\.12 or python3\\.13, then rerun this command\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"design-templates/last30days/scripts/last30days.py","lineNumber":31,"sourceCode":"import sys\nimport threading\nfrom pathlib import Path\n\nMIN_PYTHON = (3, 12)\n\n\ndef ensure_supported_python(version_info: tuple[int, int, int] | object | None = None) -> None:\n    if version_info is None:\n        version_info = sys.version_info\n    major, minor, micro = tuple(version_info[:3])\n    if (major, minor) >= MIN_PYTHON:\n        return\n    sys.stderr.write(\n        \"last30days v3 requires Python 3.12+.\\n\"\n        f\"Detected Python {major}.{minor}.{micro}.\\n\"\n        \"Install and use python3.12 or python3.13, then rerun this command.\\n\"\n    )\n    raise SystemExit(1)\n\n\nensure_supported_python()\n\nif os.name == \"nt\":\n    for stream in (sys.stdout, sys.stderr):\n        if hasattr(stream, \"reconfigure\"):\n            stream.reconfigure(encoding=\"utf-8\", errors=\"replace\")\n\nSCRIPT_DIR = Path(__file__).parent.resolve()\nsys.path.insert(0, str(SCRIPT_DIR))\n\nfrom lib import env, html_render, pipeline, render, schema, ui\n\n_child_pids: set[int] = set()\n_child_pids_lock = threading.Lock()\n\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/design-templates/last30days/scripts/last30days.py#L13-L49","documentation":"last30days v3 uses Python 3.12+ syntax (PEP 604 unions in type hints, tuple[int,int,int] generics). ensure_supported_python() runs at import time (module top-level) and compares sys.version_info against MIN_PYTHON; on an older interpreter it writes a multi-line stderr message and raises SystemExit(1) before any other code can fail with an opaque SyntaxError. The message names python3.12 / python3.13 explicitly because those are the validated targets.","triggerScenarios":"Executing `last30days.py` (or any module that imports it) with a Python interpreter whose (major, minor) is below MIN_PYTHON — e.g. `python3.11 last30days.py`, `python last30days.py` on a system where `python` is 3.10, or running via a venv built on an older runtime.","commonSituations":"macOS default `python3` still on 3.9/3.11 from Xcode CLT; a CI image pinned to python3.11; a pyenv shim resolving to an older version; a packaged/runner environment that ignores .python-version.","solutions":["Install Python 3.12 or 3.13 (`brew install python@3.12`, `pyenv install 3.13`, or use the official installer).","Invoke the script with the explicit interpreter: `python3.12 last30days.py ...` instead of `python last30days.py`.","If using a venv, recreate it from the new interpreter: `python3.12 -m venv .venv && source .venv/bin/activate`.","In CI, set the image/setup-python action to 3.12.x or 3.13.x.","Verify with `python3.12 --version` before rerunning the command."],"exampleFix":"# before\npython last30days.py --topic \"rust gui frameworks\"\n# after\npython3.12 last30days.py --topic \"rust gui frameworks\"\n# or pin a venv\npython3.12 -m venv .venv && . .venv/bin/activate\npython last30days.py --topic \"rust gui frameworks\"","handlingStrategy":"validation","validationCode":"# Check before delegating to last30days.\nimport sys\nMIN_PYTHON = (3, 12)\nif sys.version_info < MIN_PYTHON:\n    sys.exit(f\"python {'.'.join(map(str, MIN_PYTHON))}+ required, got {sys.version_info[0]}.{sys.version_info[1]}\")","typeGuard":null,"tryCatchPattern":"import subprocess, sys\ntry:\n    subprocess.run([sys.executable, 'last30days.py', '--topic', 'x'], check=True)\nexcept SystemExit as e:\n    if e.code == 1:\n        print('last30days needs Python 3.12+; rerun with python3.12', file=sys.stderr)\n    raise","preventionTips":["Pin your venv to python3.12 (`python3.12 -m venv .venv`).","Add a `.python-version` file with `3.12` for pyenv users.","CI: use setup-python with '3.12.x' or '3.13.x'."],"tags":["python","version-check","runtime-requirement","startup-guard","cli"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}