{"record":{"id":"ee3fc6953683a162","repo":"benfred/py-spy","slug":"32-bit-python-is-unsupported-on-windows","errorCode":null,"errorMessage":"32-bit python is unsupported on windows","messagePattern":"32-bit python is unsupported on windows","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/version.rs","lineNumber":47,"sourceCode":"            let major = std::str::from_utf8(&cap[2])?.parse::<u64>()?;\n            let minor = std::str::from_utf8(&cap[3])?.parse::<u64>()?;\n            let patch = std::str::from_utf8(&cap[4])?.parse::<u64>()?;\n            let build_metadata = if let Some(s) = cap.get(7) {\n                Some(std::str::from_utf8(&s.as_bytes()[1..])?.to_owned())\n            } else {\n                None\n            };\n\n            let version = std::str::from_utf8(&cap[0])?;\n            info!(\"Found matching version string '{}'\", version);\n            #[cfg(windows)]\n            {\n                if version.contains(\"32 bit\") {\n                    error!(\"32-bit python is not yet supported on windows! See https://github.com/benfred/py-spy/issues/31 for updates\");\n                    // we're panic'ing rather than returning an error, since we can't recover from this\n                    // and returning an error would just get the calling code to fall back to other\n                    // methods of trying to find the version\n                    panic!(\"32-bit python is unsupported on windows\");\n                }\n            }\n\n            return Ok(Version {\n                major,\n                minor,\n                patch,\n                release_flags: release.to_owned(),\n                build_metadata,\n            });\n        }\n        Err(format_err!(\"failed to find version string\"))\n    }\n}\n\nimpl std::fmt::Display for Version {\n    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {\n        write!(","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/benfred/py-spy/blob/32080cc0c22bc23938541dfa7dabb6090e40be14/src/version.rs#L29-L65","documentation":"py-spy cannot profile 32-bit Python processes on Windows. When scanning the loaded modules of a target process, the code detects a python DLL whose version string contains \"32 bit\" and deliberately panics, because unwinding a 32-bit Python process is unimplemented and returning an error would cause callers to silently fall back to other version-detection methods and fail later in confusing ways.","triggerScenarios":"Calling py-spy (dump/record) against a 32-bit Python interpreter on Windows: scan_bytes reads the python DLL's version info and it contains \"32 bit\", reaching the panic at src/version.rs:47.","commonSituations":"A user on Windows installed the x86 (32-bit) build of Python (common on older machines or when a 32-bit installer was downloaded by mistake) and tries to profile their script; or profiling an app that embeds a 32-bit Python DLL.","solutions":["Install and run 64-bit Python (the x86-64 Windows installer) and profile that interpreter instead.","Verify the target interpreter bitness (python -c \"import struct;print(struct.calcsize('P')*8)\") and ensure py-spy is pointed at the 64-bit process via --pid.","If 32-bit support is required, track/raise the issue at https://github.com/benfred/py-spy/issues/31 rather than attempting a workaround.","On Linux/macOS no such restriction exists; alternatively run the workload under WSL with 64-bit Python."],"exampleFix":"// before: profiling with 32-bit Python on Windows\nC:\\py> py-spy dump --pid 1234  # panics: 32-bit python is unsupported on windows\n// after: use a 64-bit interpreter\nC:\\py> python -c \"import struct;print(struct.calcsize('P')*8)\"  # ensure 64\nC:\\py> py-spy dump --pid <pid of 64-bit python>","handlingStrategy":"validation","validationCode":"import struct, sys\nif sys.platform == 'win32' and struct.calcsize('P') * 8 == 32:\n    raise SystemExit('py-spy cannot profile 32-bit Python on Windows; use a 64-bit interpreter')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the x86-64 Python build on Windows and verify with python -c \"import struct;print(struct.calcsize('P')*8)\".","Check bitness of embedded Python DLLs before pointing py-spy at them.","Avoid profiling 32-bit launchers that spawn a 64-bit child — profile the child instead."],"tags":["windows","python","unsupported-platform","panic"],"backgroundTag":null,"analyzedSha":"32080cc0c22bc23938541dfa7dabb6090e40be14","analyzedAt":"2026-09-05T19:30:55.142Z","contentChangedAt":"2026-09-05T19:30:55.142Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}