{"record":{"id":"ebaa73693338bd96","repo":"PyO3/pyo3","slug":"expected-a-bool-1-true-true-or-0-false-false-for","errorCode":null,"errorMessage":"expected a bool (1/true/True or 0/false/False) for Py_ENABLE_SHARED","messagePattern":"expected a bool \\(1/true/True or 0/false/False\\) for Py_ENABLE_SHARED","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pyo3-build-config/src/impl_.rs","lineNumber":616,"sourceCode":"                    .ok_or(concat!($key, \" not found in sysconfigdata file\"))\n            };\n        }\n\n        macro_rules! parse_key {\n            ($sysconfigdata:expr, $key:literal) => {\n                get_key!($sysconfigdata, $key)?\n                    .parse()\n                    .context(concat!(\"could not parse value of \", $key))\n            };\n        }\n\n        let soabi = get_key!(sysconfigdata, \"SOABI\")?;\n        let implementation = PythonImplementation::from_soabi(soabi)?;\n        let version = parse_key!(sysconfigdata, \"VERSION\")?;\n        let shared = match sysconfigdata.get_value(\"Py_ENABLE_SHARED\") {\n            Some(\"1\") | Some(\"true\") | Some(\"True\") => true,\n            Some(\"0\") | Some(\"false\") | Some(\"False\") => false,\n            _ => bail!(\"expected a bool (1/true/True or 0/false/False) for Py_ENABLE_SHARED\"),\n        };\n        // macOS framework packages use shared linking (PYTHONFRAMEWORK is the framework name, hence the empty check)\n        let framework = match sysconfigdata.get_value(\"PYTHONFRAMEWORK\") {\n            Some(s) => !s.is_empty(),\n            _ => false,\n        };\n        let python_framework_prefix = sysconfigdata\n            .get_value(\"PYTHONFRAMEWORKPREFIX\")\n            .map(str::to_string);\n        let lib_dir = get_key!(sysconfigdata, \"LIBDIR\").ok().map(str::to_string);\n        let gil_disabled = match sysconfigdata.get_value(\"Py_GIL_DISABLED\") {\n            Some(value) => value == \"1\",\n            None => false,\n        };\n        let cygwin = soabi.ends_with(\"cygwin\");\n        // purely descriptive of the interpreter in the sysconfigdata: PyO3's own\n        // build pipeline applies any abi3/abi3t cargo features to this config\n        // afterwards, in apply_build_env","sourceCodeStart":598,"sourceCodeEnd":634,"githubUrl":"https://github.com/PyO3/pyo3/blob/ac9b6899d348be4d54614d060dea53a645a12e36/pyo3-build-config/src/impl_.rs#L598-L634","documentation":"Parsing error raised while InterpreterConfig is built from a sysconfigdata file (from_sysconfigdata). The Py_ENABLE_SHARED value read from the _sysconfigdata module was not one of the accepted boolean spellings (1/true/True/0/false/False), e.g. an empty string or localized/unusual token, so Rust's bool parser rejected it.","triggerScenarios":"Thrown at pyo3-build-config/src/impl_.rs:616 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the generated _sysconfigdata*.py and check the Py_ENABLE_SHARED entry for stray characters or an unexpected value","Regenerate or point PYO3_CROSS_LIB_DIR/_PYTHON_SYSCONFIGDATA_NAME at a sysconfigdata file produced by the real target interpreter","If cross-compiling, fix the toolchain/sysroot that produced the malformed file"],"exampleFix":null,"handlingStrategy":"try-catch","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"}