{"record":{"id":"b63c426914d0636f","repo":"PyO3/pyo3","slug":"cannot-target-free-threaded-builds-for-python-vers","errorCode":null,"errorMessage":"Cannot target free-threaded builds for Python versions before 3.13, tried to build for {}","messagePattern":"Cannot target free-threaded builds for Python versions before 3\\.13, tried to build for (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pyo3-build-config/src/impl_.rs","lineNumber":978,"sourceCode":"\n    pub fn finalize(self) -> Result<PythonAbi> {\n        // default to GIL-enabled version-specific ABI\n        let kind = self.kind.unwrap_or(match self.implementation {\n            PythonImplementation::RustPython => PythonAbiKind::Stable(StableAbi::Abi3t),\n            _ => PythonAbiKind::VersionSpecific(GilUsed::GilEnabled),\n        });\n        if matches!(self.implementation, PythonImplementation::RustPython) {\n            ensure!(matches!(kind, PythonAbiKind::Stable(StableAbi::Abi3t)),\n                    \"RustPython only supports targeting abi3t, it does not allow targeting other Python ABIs. Currently targeting '{kind}'\")\n        }\n        if matches!(kind, PythonAbiKind::VersionSpecific(GilUsed::FreeThreaded))\n            && self.version\n                < (PythonVersion {\n                    major: 3,\n                    minor: 13,\n                })\n        {\n            bail!(\n                \"Cannot target free-threaded builds for Python versions before 3.13, tried to build for {}\", self.version\n            )\n        }\n        Ok(PythonAbi {\n            implementation: self.implementation,\n            kind,\n            version: self.version,\n        })\n    }\n}\n\n#[non_exhaustive]\n#[derive(Copy, Clone, PartialEq, Eq)]\n#[cfg_attr(test, derive(Debug))]\npub struct PythonAbi {\n    implementation: PythonImplementation,\n    kind: PythonAbiKind,\n    version: PythonVersion,","sourceCodeStart":960,"sourceCodeEnd":996,"githubUrl":"https://github.com/PyO3/pyo3/blob/ac9b6899d348be4d54614d060dea53a645a12e36/pyo3-build-config/src/impl_.rs#L960-L996","documentation":"Validation failure in PythonAbiBuilder::finalize: the requested configuration selects a free-threaded (Py_GIL_DISABLED) build, but the resolved target Python version is older than 3.13, the first CPython release with a free-threaded ABI. The combination is impossible, so finalize aborts ABI construction.","triggerScenarios":"Thrown at pyo3-build-config/src/impl_.rs:978 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Target Python 3.13 or newer when a free-threaded build is requested","Drop the free-threaded selection (do not enable Py_GIL_DISABLED / free-threaded ABI) for older interpreters","Set PYO3_CROSS_PYTHON_VERSION to an accurate version so the check sees the real interpreter version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ac9b6899d348be4d54614d060dea53a645a12e36","analyzedAt":"2026-09-05T09:20:35.319Z","contentChangedAt":"2026-09-05T09:20:35.319Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}