PyPy v8.1.1: release of python 2.7 and 3.12 released 2026-XX-XX¶
Note
This is a pre-release announcement. When the release actually happens, it will be announced on the PyPy blog
The PyPy team is proud to release version 8.1.1 of PyPy after the previous release on Oct 14, 2026. We have dropped 3.11. Increased compatibility with CPython’s C API changed some of the structs exposed in the C headers, so we are bumping the version to 8.1. We have seen a lot of activity: people have been using various tools to fuzz and analyse the interpreter and this has led to a lot of churn for edge case compatibility and crash protection. We have also started passing many more tests on all platforms, and have removed the last vestiges of RPython unicode from the interpreter, allowing us to simplify RPython. This becomes important as the long-term effort to make RPython compatible with python3 (rpython3 )has move forward.
The release includes two different interpreters:
PyPy2.7, supporting the syntax and the features of Python 2.7 including the stdlib for CPython 2.7.18+ (the
+is for backported security updates)PyPy3.12, supporting the syntax and features of Python 3.12, including the stdlib for CPython 3.12.16.
The interpreters are based on much the same codebase, thus the double release.
We recommend updating. You can find links to download the releases here:
We would like to thank our donors for the continued support of the PyPy project. If PyPy is not quite good enough for your needs, we are available for direct consulting work. If PyPy is helping you out, we would love to hear about it and encourage submissions to our blog via a pull request to https://github.com/pypy/pypy.org
We would also like to thank our contributors and encourage new people to join the project. PyPy has many layers and we need help with all of them: bug fixes, PyPy and RPython documentation improvements, or general help with making RPython’s JIT even better.
If you are a python library maintainer and use C-extensions, please consider making a CFFI version of your library that would be performant on PyPy. Failing that, PyPy will soon support the cp312-abi3 tag for limited ABI wheels. In any case, cibuildwheel supports building wheels for PyPy.
What is PyPy?¶
PyPy is a Python interpreter, a drop-in replacement for CPython. It’s fast (PyPy and CPython performance comparison) due to its integrated tracing JIT compiler.
We also welcome developers of other dynamic languages to see what RPython can do for them.
We provide binary builds for:
x86 machines on most common operating systems (Linux 32/64 bits, Mac OS 64 bits, Windows 64 bits)
64-bit ARM machines running Linux (
aarch64) and macos (macos_arm64).
PyPy supports Windows 32-bit, Linux PPC64 big- and little-endian, Linux ARM 32 bit, RISC-V RV64IMAFD Linux, and s390x Linux but does not release binaries. Please reach out to us if you wish to sponsor binary releases for those platforms. Downstream packagers provide binary builds for debian, Fedora, conda, OpenBSD, FreeBSD, Gentoo, and more.
Changelog¶
For all python versions¶
Lazily import rpython.conftest (and hence pytest) during translation (#5654)
macos: sign dylibs with an ad-hoc signature in packaging to allow using the dylib (:issue:’5758`)
Windows: cache msvc compiler env when running heavy compilation tests, massively speeds up test times
remove rpython unicode from pypy, rpython/rlib, and associated tests (#5759)
packaging: speed up openssl
'make install', extend macos gha translate timeoutAdd proofs for missing cases in knownbits shrinking (#5809)
Update libexpat to 2.9.0
Bugfixes¶
aarch64: load float constants with a PC-relative LDR from a literal pool (#5649)
aarch64: add missing
finish_oncein assembler’s runneraarch64: build
+0.0andFMOV-encodable float constants without a load (#5657)rordereddict: don’t leave GC pointers in entries emptied in place (#5686)
Windows: fix
_sslerrors on 2.7prevent race in cffi codegen
Move
PYPY_JIT_DETECT_REENTRANCY, used to print out a stack trace when testing PyPy and an imminent crash is detected, to an env variableCatch the reentrancy problem: defer asmmemmgr frees that reenter during a gc
macos: Delay async exception handling tripped during running finalizers until the run is complete
Windows: fix
signalerror handlingWindows: wrap more system calls that can abort with
SuppressIPHWindows: resolve symlinks in
resolvedirofWindows: use
wchrentry points foros.spawnv*(#5738)Windows: better error reporting of waitstatus_to_exitcode (#5738)
fix set corruption when
__eq__mutates the set indifference_updateanddifference(#5765)change ppc-64 to powerpc64le (python2.7 only)
Don’t rely on signed overflow when overallocating RPython lists (#5773, #5799)
rsre: apply the zero-width protection of MIN_UNTIL to backtracked items (#5773, #5798)
Windows: speed up GIL handoffs between threads (#5797)
Mark the blackhole interpreter chain as “stack-critical” code (#5761)
Fix forked JIT execution on threads on macos-arm64 by making the page counter a thread-local symbol
Speedups and enhancements¶
rbigint: make shift loops vectorizable, no carry between iterations (#5708). Speeds up shifts for big integers in PyPy.
rbigint: improve arithmetic, shifts, and float conversion (#5750)
rbigint: vectorize bitwise operations (and/or/xor) (#5754)
Make ruleopt generate more compact and faster code (#5655)
Add integer simplifications for subtraction zero tests and left-shift overflow checks (#5633)
ruleopt IntBounds method contracts (#5732)
port the integer comparison optimizations to the rule DSL (#5722)
jit: improve intbound arithmetic (#5832)
Python 3.12¶
Fix failing tests for windows64:
-Atest were not running at all, others were crashingWindows: add enough of rvmprof to get faulthandler working (#5725)
unicode.splitlines: add an ASCII fast path that scans bytes without decoding (#5719)
Allow importing cp312-abi3 c-extension modules, including building a python3.dll mapping library on windows and hacking at wheel tags supported by pip et.al to allow cp312-abi3 (#5578)
Update to stdlib 3.12.16 and port an
_sslverify callback
C API (cpyext)¶
Respect
Py_TPFLAGS_SEQUENCEandPy_TPFLAGS_MAPPINGin static types (#5736)Fix type objects’ refcount handling for subtypes of builtin types (#5736)
Copy all slots from the base
pto(#5736)Properly handle all the different ways to hit
tp_dealloc(#5756)Run
tp_finalizeand track it in the prefix likePyGC_HEAD(#5743)Run finalizers again after another collect to run both
tp_deallocandtp_finalize(#5803)Refactor cdatetime to be compatible with cpython structs and headers (#5764)
remove unused
PyBytesObject.ob_sstate(#5764)Make len(bytesarray) and PyByteArray.ob_size match (#5764)
Add
Py_LIMITED_APIto headers and hide functions when it is defined (#5764)Give interp-level builtins a
PyCFunctionObjectlayout with a validm_ml, so thePyCFunction_GET_*macros work (#5803)getsetdescr_attach: fall back to the owning class when unbound (#5803)Decrement tick counter on c-extension callbacks to allow GIL release (#5803)
testing: fix emulated GIL and untranslated GIL test in cpyext (#5803)
make strides, shape on Py_Buffer be pointers to view-owned data for compatibility with CPython for ABI3 (#5802)
Add a fast path through
wrap_callfor vectorcall (#5802)Prefer running cpyext deallocators in the main thread (#5802)
cdatetime: use internal attributes instead of public setters for W_Datetime* attach (#5805)
Handle StackOverflow better in wrapped cpyext calls (#5810, #5811)
Leave stack headroom for C code after a cpyext RecursionError (#5810)
Ready an unready static
tp_basein cpyextPyType_Ready(#5821)Prefer cts.decl over cpython_api declarations to clear up long/int confusion (#5819)
Implement stubbed-out
PyFrame_GetCodeandPyFrame_GetBack(#5820)Only refresh slots that changed in
PyType_Modifiedto preserve possible attributesProperly export
PyModuleDef_TypeOnly add a
__getattr__wrapper fortp_getattr, nottp_getattroDon’t apply the
_getattr__fallback whentp_getattroowns attribute lookupImprove safety checks for args to
Base.__new__and fix edge cases intp_newFix edge case (align with CPython bug?) in
PyNumber_InPlacePowerfor compatibility
Testing¶
ctypes tests: don’t call a non-variadic function with partial argtypes (#5652)
cffi tests: port test_ffi_new_allocator_1 (#5651)
Remove tests that replicate lib-python tests (#5672)
rmmap: untranslated macOS arm64 JIT memory uses mprotect, not MAP_JIT (#5662)
PyPY’s
switchintervalis much higher than CPython’s, causing races in some tests. Add explicit waits to improve reproducibilityBackport
_pytestchanges to main (#5767)Add a delay after starting the first test worker thread to prevent cache races (#5800)
Convert some app-level tests to new-style apptests (i.e. moving from test_abc.py to apptest_abc.py) (#5812).
Other bugfixes including missing compatibility¶
Improve
_sslerror types and handlingNormalize
fsencinget_special_char()so it does not return None (#5650)_curses: declare the wide-character functions on darwin (#5661)always use utf-8/surrogateescape for fsencode/fsdecode, fixes darwin failures (#5659)
time.strftime: only pass ASCII runs of the format towcsftime()(#5665)Add fcopyfile() on darwin (#5670) that needed an rpython helper (#5671)
Skip the codec lookup when decoding empty input outside dev mode (#5669)
Read
ZLIB_RUNTIME_VERSIONat runtime startup, rather than at buildBackport 3.16
bz2.versionandbz2.version_infoto report the runtime bz2 version (#5666)Use zlib-ng on macos via the pypy/externals repo during translation
decode_object: check for empty input after the ascii/utf-8 fast paths (#5673)
test_all_pathconf_defined: allow the OS to reject a name for this fd (#5674)
app_main:
PYTHONOPTIMIZE=0and similar flags meanoff(#5679)Refactor
is_python_functionto report hidden applevel code as-if it is a builtin. Fixes_lsprofby insuring eachCALLhas a matching returnFix
get_channel_bindingin_ssl(#5676)posix: count OS threads on darwin for the
fork()warning, and include thepidin the warning (#5682)array: add
__class_getitem__(#5683)pyrepl: rename
append_history_file()toappend_unsaved_history()and defineappend_history_file(nelements, filename=None, /)like readline (#5680)test_mmap: collect leftover mmaps before removing the test file, important on windows (#5685)
_socket: check that thefilenopassed tosocket()is a socket, important on macos (#5687)Restore many PyPy-specific stdlib adaptations from 3.11 to 3.12 (#5684)
except*: supportBaseExceptionsthat are notExceptions(#5689)- pdb: port remote debugging support from CPython (#5667)generators: warn about the 3-argument
throw()(#5692)Use different docstrings for coroutines and generators, even though they share common code (#5691)
Fix
strftimeon windows for a year before 1900Add missing _winapi and nt interfaces for windows (#5708)
Set
__module__ofoperator.attrgetter,itemgetterandmethodcallerto'operator'(#5695)Use
__index__when doing__float__(#5696)math.factorial: convert the argument with
index()before checking its range (#5699)Only accept an exact int in csv.field_size_limit() (#5703)
Validate the islice() arguments before calling iter() on the iterable (#5704)
Add
__reduce__to_operators.*add a
ReopeningLookupsubclass to read the centralZipFiledirectory once and close the archive, allowing windows to release the fileupdate CFFI’s pycparser to 3.12
Fix the source range highlighted in tracebacks when a method call raises an exception (6f3bc549eca)
Check
globalarg towarn_explicitRemove
f->gformatting conversion for large floats (#5706)Get rid of RPython unicode and use
surrogatepasson windows (#5709)Port CPython3.13
pytime.cto get ns resolution on windows (#5376)Windows: fix
os.statfor a file that cannot be openedWindows: fix and use winconsoleio by default
Pickler: use DEFAULT_PROTOCOL not HIGHEST_PROTOCOL (#5710)
Refactor LZMACompressor, LZMADecompressor to define
__new__rather than__init__posix: raise rather than return errno (#5711)
peepholer tests: turn jump + return into a return
Windows: fix unicode conversions in array module (#5715)
Windows: simplify rpython unsetenv/delenv
pathlib: cache
pathlib._strearly to reduce recursion framesWindows: make utime more precise via GetSystemTimePreciseAsFileTime
fix pickle/unpickle of range-iterators
Windows: modernize socket: use enums not macros, add a SIO_LOOPBACK_FAST_PATH to ioctl_w, fix dup, drop TCP_KEEPALIVE
Rebuild exception subgroups exactly like CPython (#5713)
math.log: improve the robustness of the algorithm and special-case 2 and 10. (#5700)
implement more precise sum of floats following python/cpython#100426 (#5720)
fix crash when trying to pass a non-dict object to a __dict__ descriptor’s methods (#5733)
Windows: fix
_sqlite3error reportingtest_posix2: check major()/minor() of
NODEVonly on Linux, not macos (#5724)Windows: fix exit code when trapping KeyboardInterrupt
Windows: improve
mmaperror handlingWindows: fill in more details of
_overlappedfor error statesWindows: add listmounts (#5738)
Accept arguments in
Pickler.__new__(#5727)Add unused
gc.callbackfor dask benchmark compatibilityMake a venv-of-venv climb through the
pyvenv.cfgchain to find the base pypypickler: break reducer cycles for cloudpickle compatibility
select: invalidate kqueue objects in a forked child (#5730)
Fix
__reduce__of exhausted dict and set iterators (#5733, #5735)Fix
__reduce__of enumerate over a list and of exhausted tee iterators (#5733, #5737)pickle: fix unpickling of missing memo entries and non-UTF-8 text lines (#5733, #5780)
Fix BytesIO and StringIO crashes on huge positions and on closing in
__index__(#5733, #5739)Raise MemoryError when an array’s byte size overflows (#5733, #5752)
Raise ValueError when a buffered stream is detached during an operation (#5733, #5793)
Convert the size before checking that a buffered stream is open (#5733, #5793)
Keep using the same iterator in
islice.__next__during reentrant calls (#5733, #5792)Clamp start and end in the built-in codec error handlers (#5733, #5796)
tee: call
iter()twice, ignore__copy__, and call nothing for n == 0. Also objects for start or step that only define__index__(#5705, #5702)itertools.count(): allow objects for start or step that only define
__index__(#5705, #5702)bytearray: Convert the item before reading the data in append/insert (#5768, #5702)
sqlite3: read the backup error string with
ffi.string()before decoding it (#5731)Fix fatal AssertionError on multi-line fields in triple-quoted f-strings (#5776)
Build the nested f-string in
test_fstring_nesting_limitswithout recursion (#5790)tokenizer: Raise “invalid decimal literal” for bad float exponents in Tokenizer and remove old tokenizer (#5777)
tokenizer: Make DFA.recognize return the longest match (#5778)
tokenizer: Prove the whitespace match is non-negative (#5778)
Return the left operand’s type from
^when the left set is empty (#5774, #5729)Do not order equal steps in
slice.__lt__, addslice.__le__,__gt__and__ge__(#5773, #5729)Check for a mapping before scanning a
%(key)format (#5772, #5729)Check that the first argument of
super()is a type whenever it is given (#5770, #5729)Accept and ignore arguments in
_thread.RLock()(#5786, #5729)Compute
math.degrees()asx * (180 / pi)to improve accuracy (#5784, #5729)Take
abs()of the converted value in one-argumentmath.gcd()(#5783, #5729)Convert math.remainder() arguments like the other math functions (#5782, #5729)
Store an exact int in itertools.count() for an int start with step 1 (#5785, #5729)
packaging: call
build_cffi_importswith the target interpreter not the host interpreter, add a cc -arch flag for macos x86-64 (#5791)marshal: pass the text of TYPE_FLOAT` and
TYPE_COMPLEXto float() as bytes not str (#5795)Check the length of the state in
itertools.product.__setstate__(#5794)Fix compiler crash on break/continue/return out of try/except*/finally (#5801, #5806)
Fix
readinto()of BufferedRandom reading buffered data twice (#5801, #5813)Close the exception scopes of
finallyandwithblocks on every early exit (#5801, #5815)Lessen chances for a GIL <-> lock race when building rlib cache entries
Sync
builtins.__debug__with-Oon the command lineDo not allow instantiating
dict.keys,values,itemsexcept as subclasses
Speedups¶
Use a proxy for unicode dict keys that does not require wrapping them into W_Unicode objects (ebf6514ecd9)
RPython3¶
We are slowly starting the investigation whether RPython can be ported to be based on Python 3. We merged some preliminary PRs in this direction:
Refactor backticks,
has_key,ur"", and bare tuples in comprehensions (#5740)extregistry: build FlexibleWeakDict on object instead of DictMixin (#5749)
alias
__bool__and__next__to the Python 2 names (#5747)sorted()and Python 3 style iteration in host code (#5745)flow space looks up host built-ins through
twothree.builtins(#5751)sys.maxsizeinstead ofsys.maxint(#5746)rename stdlib modules, via Python 2.7 spellings or twothree (#5753)
flowspace: decode bytecode into an instruction list before flowing (#5763)
Some missed 2to3 fixes (#5817)