[`patch-ctypes-static-binary.patch`](https://github.com/astral-sh/python-build-standalone/blob/main/cpython-unix/patch-ctypes-static-binary.patch) Code that runs at ctypes module import time does not work with non-dynamic binaries. This patch fixes ctypes to work with statically linked binaries. See https://bugs.python.org/issue37060
Activity
zanieb commentedon Nov 26, 2025
See also python/cpython#81241
brettcannon commentedon Jan 23, 2026
This seems reasonable.
ZeroIntensity commentedon Jul 18, 2026
See python/cpython#153890 for a PR upstreaming the patch.
gh-81241: Fix importing `ctypes` from statically linked interpreters (G…
ZeroIntensity commentedon Sep 28, 2026
The upstream patch has now been merged.
[3.13] gh-81241: Fix importing `ctypes` from statically linked interp…
[3.14] gh-81241: Fix importing `ctypes` from statically linked interp…
[3.15] gh-81241: Fix importing `ctypes` from statically linked interp…
zaniebot commentedon Oct 23, 2026
Upstreamed in python/cpython#153890 and backported to Python 3.13, 3.14, and 3.15. PBS still applies the patch for Python 3.12 and older.