NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #77 most downloaded on PyPI
Lightweight in-process concurrent programming
Last release 20 days ago
14 Sep 2026
Release timing varies
gaps range from 9 days to 4 months
Nearly every release is documented
notes for 55 of 57 stable releases
Nothing withdrawn
no release was ever pulled
21 years old
69 releases · first in 2006
Correct a race condition that could lead to garbage collection unintentionally being disabled. See PR 529 _ by Yurii.
Correct a race condition that could lead to garbage collection unintentionally being disabled. See PR 529 by Yurii.
Link the C++ runtime statically into the Windows wheels again, as the Appveyor builds did through 3.3.0. Since 3.3.1 _greenlet.pyd imported MSVCP140.d
Link the C++ runtime statically into the Windows wheels again, as the Appveyor builds did through 3.3.0. Since 3.3.1 _greenlet.pyd imported MSVCP140.dll, which no Windows CPython distribution ships, so importing greenlet failed on machines without the Visual C++ redistributable. See issue 525. Issue and pull request by Daniel Sticker.
Note
Binary 3.15 wheels are now built with 3.15.0rc1. This should be compatible with future 3.15 releases and is believed compatible with 3.15b4 as well (but not earlier versions).
One column per quarter.
Fix a crash (segfault) on free-threaded builds of Python 3.14 and later when the garbage collector runs while a greenlet that was started from a non-e
Fix a crash (segfault) on free-threaded builds of Python 3.14 and later when the garbage collector runs while a greenlet that was started from a non-empty C-stack-reference state is active. See issue 515. Thanks to ddorian and Kumar Aditya.
Fix a potential use-after-free on free-threaded builds of Python 3.14 and later when the garbage collector runs while a greenlet is suspended holding a _PyCStackRef (for example, mid attribute resolution). See issue 515. Thanks to ddorian and Kumar Aditya.
Fix a deadlock on free-threaded builds when a greenlet switch happened while a PyCriticalSection was held -- for example inside asyncio's Task.__step, which holds one on the running task for the duration of the step. See PR 519 <https://github.com/python-greenlet/greenlet/pull/519/>. Thanks to ddorian and Kumar Aditya.
Note
Binary 3.15 wheels are now built with Python 3.15b4. These may not be compatible with earlier or later versions of 3.15. Binary 3.15 wheels of greenlet from previous releases (e.g., 3.5.3) may not be compatible with Python 3.15b4.
Fix a crash on free-threaded builds when multiple greenlets were holding a critical section on an object and the GIL for the thread was dropped. See i
Fix a crash on free-threaded builds when multiple greenlets were holding a critical section on an object and the GIL for the thread was dropped. See issue 513. Thanks to ddorian.
The minimum supported version of Python 3.15 is now 3.15b2.
Add preliminary support for Python 3.15b1. This has not been reviewed by CPython core developers, but all tests pass. Binary wheels of this version wo
Add preliminary support for Python 3.15b1. This has not been reviewed by CPython core developers, but all tests pass. Binary wheels of this version won't work on earlier Python 3.15 builds and may not work on later 3.15 builds.
Fix the discrepancy in the way the two getcurrent APIs behave during greenlet teardown. One API (the C API used by, e.g., gevent) raised a RuntimeError; the other (the Python greenlet.getcurrent API) returned None. This second way is incompatible with greenlet's type annotations, so greenlet.getcurrent now raises a RuntimeError as well.
Remove the atexit callback. This callback caused greenlet APIs to become unavailable far too soon during interpreter shutdown. Now they remain availab
Remove the atexit callback. This callback caused greenlet APIs to become unavailable far too soon during interpreter shutdown. Now they remain available while all atexit callbacks run. Sometime after Py_IsFinalizing becomes true, they may begin misbehaving. Because the order in which C extensions are finalized is undefined, C extensions that are sensitive to this need to check the results of that function before invoking greenlet APIs. As a convenience, PyGreenlet_GetCurrent sets an exception and returns NULL when this happens (and greenlet.getcurrent begins returning None); other greenlet C API functions have undefined behaviour. Methods invoked directly on pre-existing greenlet.greenlet objects will continue to function at least until the greenlet C extension has been garbage collected and finalized.
See PR 508.
Publish binary wheels for RiscV 64.
Publish binary wheels for RiscV 64.
Fix multiple rare crash paths during interpreter shutdown.
Note that this now relies on the atexit module, and introduces subtle API changes during interpreter shutdown (for example, getcurrent is no longer available once the atexit callback fires).
See PR #499 by Nicolas Bouvrette.
Address the results of an automated code audit performed by Daniel Diniz. This includes several minor correctness changes that theoretically could have been crashing bugs, but typically only in very rare circumstances.
See PR 502.
Fix several race conditions that could arise in free-threaded builds when using greenlet objects from multiple threads, some of which could lead to assertion failures or interpreter crashes.
See issue 503, with thanks to Nitay Dariel and Daniel Diniz.
Fix a crash on Python 3.10 if there are active greenlets during interpreter shutdown. See PR 495 _ by Nicolas Bouvrette.
Fix a crash on Python 3.10 if there are active greenlets during interpreter shutdown. See PR 495 by Nicolas Bouvrette.
Publish Windows ARM binary wheels, where available.
Publish Windows ARM binary wheels, where available.
Fix compilation for 3.14t on Windows.
Publish Windows 3.14t binary wheels for Intel.
Switch from Appveyor for Windows to Github Actions.
Fix compilation on MIPS with GCC 15 and binutils 2.45. See PR 487 by Rosen Penev. Note that this is not a platform tested by this project's CI.
Move most project metadata into the static pyproject.toml file. This updates licensing information to use the modern License-Expression field. See PR 480 by mrbean-bremen.
Switch to distributing manylinux_2_28 wheels instead of manylinux2014 wheels. Likewise, switch from musllinux_1_1 to 1_2.
Drop support for Python 3.9.
Switch to distributing manylinux_2_28 wheels instead of manylinux2014 wheels. Likewise, switch from musllinux_1_1 to 1_2.
Add initial support for free-threaded builds of CPython 3.14. Due to limitations, we do not distribute binary wheels for free-threaded CPython on Windows. (Free-threaded CPython 3.13 may work, but is untested and unsupported.)
Caution!
Under some rare scenarios with free-threaded 3.14, the interpreter may crash on accessing a variable or attribute or when shutting down. If this happens, try disabling the thread-local bytecode cache. See the greenlet documentation for more details. See PR 472 by T. Wouters for the initial free-threaded support and a discussion of the current known issues.
The 3.2.x series will be the last to support Python 3.9.
Note
The 3.2.x series will be the last to support Python 3.9.
Backport the changes from PR 495 in release 3.3.2 for Python 3.9.
Note
No Windows wheels will be published for this version.
The 3.2.x series will be the last to support Python 3.9.
Note
The 3.2.x series will be the last to support Python 3.9.
Various small build/test changes for less common configurations (e.g., building CPython with assertions enabled but NOT debugging), contributed by Michał Górny. Note that while greenlet will BUILD in a free-threaded Python, it will cause the GIL to be allocated and used, and memory may leak. Also note that these configurations are not tested by this project's CI.
Fix an assertion error on debug builds of Python 3.14 when using the experimental JIT. See issue 460.
Make greenlet build and run on Python 3.14 beta 2 on Windows amd64.
Make greenlet build and run on Python 3.14 beta 2 on Windows amd64.
Potentially fix build on NetBSD/sparc64. See PR 447.
Make greenlet build and run on Python 3.14 beta 1. It will not run on earlier versions of 3.14; it should run on subsequent versions. See PR 445 _.
Make greenlet build and run on Python 3.14 beta 1. It will not run on earlier versions of 3.14; it should run on subsequent versions. See PR 445.
Fix a crash regression for Riscv64. See issue 443 _.
Fix a crash regression for Riscv64. See issue 443.
Remove support for Python 3.7 and 3.8.
Remove support for Python 3.7 and 3.8.
Add untested, community supported implementation for RiscV 32. See PR 438.
Make greenlet build and run on Python 3.14a7. It will not build on earlier 3.14 alpha releases, and may not build on later 3.14 releases.
Packaging: Use 639 license expressions and include license files.
Fix crashes on 32-bit PPC Linux. Note that there is no CI for this, and support is best effort; there may be other issues lurking. See issue 422 _.
Fix crashes on 32-bit PPC Linux. Note that there is no CI for this, and support is best effort; there may be other issues lurking. See issue 422.
Remove unnecessary logging sometimes during interpreter shutdown. See issue 426.
Fix some crashes on 32-bit PPC MacOS. This is a very old platform, and is only known to be tested on beta versions of an operating system that was never released, using the GCC 14 only provided by MacPorts; it may or may not work on the final MacOS X release that supported 32-bit PowerPC. It has the known issue of leaking memory when greenlets are used in multiple threads. Help debugging this would be appreciated. See PR 419.
This will be the last release to support Python 3.7 and 3.8.
Note
This will be the last release to support Python 3.7 and 3.8.
Adds support for Python 3.13.
Note
greenlet will not work in no-gil (free threaded) builds of CPython. Internally, greenlet heavily depends on the GIL.
Greatly reduce the chances for crashes during interpreter shutdown. See issue 411.
Support for the following platforms was contributed by the community. Note that they are untested by this project's continuous integration services.
Hitachi's SuperH CPU.
RiscV 64 with -fno-omit-frame-pointer. Note that there are known test failures, so this platform may not work reliably at all.
Python 3.12: Restore the full ability to walk the stack of a suspended greenlet; previously only the innermost frame was exposed. See issue 388 _. Fix
Packaging: Add a minimal pyproject.toml to sdists.
Packaging: Add a minimal pyproject.toml to sdists.
Packaging: Various updates to macOS wheels.
Fix a test case on Arm32. Note that this is not a supported platform (there is no CI for it) and support is best effort; there may be other issues lurking. See issue 385
Fix a potential crash on Python 3.8 at interpreter shutdown time. This was a regression from earlier 3.0.x releases. Reported by Matt Wozniski in issu
Fix a potential crash on Python 3.8 at interpreter shutdown time. This was a regression from earlier 3.0.x releases. Reported by Matt Wozniski in issue 376.
No changes from 3.0rc3 aside from the version number.
No changes from 3.0rc3 aside from the version number.
Fix an intermittent error during process termination on some platforms (GCC/Linux/libstdc++).
Fix an intermittent error during process termination on some platforms (GCC/Linux/libstdc++).
Fix some potential bugs (assertion failures and memory leaks) in previously-untested error handling code. In some cases, this means that the process w
Fix some potential bugs (assertion failures and memory leaks) in previously-untested error handling code. In some cases, this means that the process will execute a controlled abort() after severe trouble when previously the process might have continued for some time with a corrupt state. It is unlikely those errors occurred in practice.
Fix some assertion errors and potential bugs with re-entrant switches.
Fix a potential crash when certain compilers compile greenlet with high levels of optimization. The symptom would be that switching to a greenlet for the first time immediately crashes.
Fix a potential crash when the callable object passed to the greenlet constructor (or set as the greenlet.run attribute) has a destructor attached to it that switches. Typically, triggering this issue would require an unlikely subclass of greenlet.greenlet.
Python 3.11+: Fix rare switching errors that could occur when a garbage collection was triggered during the middle of a switch, and Python-level code in __del__ or weakref callbacks switched to a different greenlet and ultimately switched back to the original greenlet. This often manifested as a SystemError: "switch returned NULL without an exception set."
For context on the fixes, see gevent issue #1985.
Windows wheels are linked statically to the C runtime in an effort to prevent import errors on systems without the correct C runtime installed. It's n
Windows wheels are linked statically to the C runtime in an effort to prevent import errors on systems without the correct C runtime installed. It's not clear if this will make the situation better or worse, so please share your experiences in issue 346.
Note that this only applies to the binary wheels found on PyPI. Building greenlet from source defaults to the shared library. Set the environment variable GREENLET_STATIC_RUNTIME=1 at build time to change that.
Build binary wheels for Python 3.12 on macOS.
Fix compiling greenlet on a debug build of CPython 3.12. There is one known issue that leads to an interpreter crash on debug builds.
Python 3.12: Fix walking the frame stack of suspended greenlets. Previously accessing glet.gr_frame.f_back would crash due to changes in CPython's undocumented internal frame handling.
Now, greenlet may compile and work on Windows ARM64 using llvm-mingw, but this is untested and unsupported. See PR by Adrian Vladu.
Now, greenlet may compile and work on LoongArch64 Linux systems, but this is untested and unsupported. See PR 257 by merore.
There may be (very) subtle issues with tracing on Python 3.12, which has redesigned the entire tracing infrastructure.
Build binary wheels for S390x Linux. See PR 358 _ from Steven Silvester.
Build binary wheels for S390x Linux. See PR 358 from Steven Silvester.
Fix a rare crash on shutdown seen in uWSGI deployments. See issue 330 and PR 356 from Andrew Wason.
Make the platform-specific low-level C/assembly snippets stop using the register storage class. Newer versions of standards remove this storage class, and it has been generally ignored by many compilers for some time. See PR 347 from Khem Raj.
Add initial support for Python 3.12. See issue and PR; thanks go to (at least) Michael Droettboom, Andreas Motl, Thomas A Caswell, raphaelauv, Hugo van Kemenade, Mark Shannon, and Petr Viktorin.
Remove support for end-of-life Python versions, including Python 2.7, Python 3.5 and Python 3.6.
Require a compiler that supports noinline directives. See issue 271.
Require a compiler that supports C++11.
Fix calling greenlet.settrace() with the same tracer object that was currently active. See issue 332 _.
Fix calling greenlet.settrace() with the same tracer object that was currently active. See issue 332.
Various compilation and standards conformance fixes. See #335, #336, #300, #302, #334.
Python 3.11: Fix a memory leak. See issue 328 _ and gevent issue 1924 _.
Python 3.11: Fix a memory leak. See issue 328 and gevent issue 1924.
Add Programming Language :: Python :: 3.11 to the PyPI classifier metadata.
Add Programming Language :: Python :: 3.11 to the PyPI classifier metadata.
- Nothing changed yet.
Nothing changed yet.
Linux: Fix another group of rare crashes that could occur when shutting down an interpreter running multiple threads. See issue 325 _.
Linux: Fix another group of rare crashes that could occur when shutting down an interpreter running multiple threads. See issue 325.
Linux: Fix a rare crash that could occur when shutting down an interpreter running multiple threads, when some of those threads are in greenlets makin
Linux: Fix a rare crash that could occur when shutting down an interpreter running multiple threads, when some of those threads are in greenlets making calls to functions that release the GIL.
Python 2: Fix a crash that could occur when raising an old-style instance object.
Python 2: Fix a crash that could occur when raising an old-style instance object.
Workaround a CPython 3.8 bug _ that could cause the interpreter to crash during an early phase of shutdown with the message "Fatal Python error: Pytho
Workaround a CPython 3.8 bug that could cause the interpreter to crash during an early phase of shutdown with the message "Fatal Python error: Python memory allocator called without holding the GI." This only impacted CPython 3.8a3 through CPython 3.9a5; the fix is only applied to CPython 3.8 releases (please don't use an early alpha release of CPython 3.9).
Rename the C API function PyGreenlet_GET_PARENT to PyGreenlet_GetParent for consistency. The old name remains available as a deprecated alias.
Deal gracefully with greenlet switches that occur while deferred deallocation of objects is happening using CPython's "trash can" mechanism. Previously, if a large nested container held items that switched greenlets during delayed deallocation, and that second greenlet also invoked the trash can, CPython's internal state could become corrupt. This was visible as an assertion error in debug builds. Now, the relevant internal state is saved and restored during greenlet switches. See also gevent issue 1909.
Rename the C API function PyGreenlet_GET_PARENT to PyGreenlet_GetParent for consistency. The old name remains available as a deprecated alias.
Fix a crash on older versions of the Windows C runtime when an unhandled C++ exception was thrown inside a greenlet by another native extension. This
Fix a crash on older versions of the Windows C runtime when an unhandled C++ exception was thrown inside a greenlet by another native extension. This is a bug in that extension, and the interpreter will still abort, but at least it does so deliberately. Thanks to Kirill Smelkov. See PR 286.
Musllinux wheels for aarch64 are now built, tested, and uploaded to PyPI. Thanks to Alexander Piskun.
This version of greenlet is known to compile and pass tests on CPython 3.11.0a6. Earlier 3.11 releases will not work; later releases may or may not work. See PR 294. Special thanks to Victor Stinner, Brandt Bucher and the CPython developers.
Add experimental, untested support for 64-bit Windows on ARM using MSVC. See PR 271 _.
Add experimental, untested support for 64-bit Windows on ARM using MSVC. See PR 271.
Drop support for very old versions of GCC and MSVC.
Compilation now requires a compiler that either supports C++11 or has some other intrinsic way to create thread local variables; for older GCC, clang and SunStudio we use __thread, while for older MSVC we use __declspec(thread).
Wheels compatible with the musllinux specification are built, tested, and uploaded to PyPI for x86_64. (This was retroactively done for version 1.1.2 as well.)
This version of greenlet is known to compile and pass tests on CPython 3.11.0a4. Earlier or later 3.11 releases may or may not work. See PR 280. Special thanks to Brandt Bucher and the CPython developers.
Fix several leaks that could occur when using greenlets from multiple threads. For example, it is no longer necessary to call getcurrent() before exiting a thread to allow its main greenlet to be cleaned up. See issue 252.
Fix the C API PyGreenlet_Throw to perform the same error checking that the Python API greenlet.throw() does. Previously, it did no error checking.
Fix C++ exception handling on 32-bit Windows. This might have ramifications if you embed Python in your application and also use SEH on 32-bit windows, or if you embed Python in a C++ application. Please contact the maintainers if you have problems in this area.
In general, C++ exception handling is expected to be better on most platforms. This work is ongoing.
The repr of some greenlets has changed. In particular, if the greenlet object was running in a thread that has exited, the repr now indicates that. NOTE: The repr of a greenlet is not part of the API and should not be relied upon by production code. It is likely to differ in other implementations such as PyPy.
Main greenlets from threads that have exited are now marked as dead.
Add musllinux (Alpine) binary wheels.
Add musllinux (Alpine) binary wheels.
Important
This preliminary support for Python 3.11 leaks memory. Please upgrade to greenlet 2 if you're using Python 3.11.
Add support for Python 3.11. Please note that Windows binary wheels are not available at this time.
Add support for Python 3.11. Please note that Windows binary wheels are not available at this time.
Important
This preliminary support for Python 3.11 leaks memory. Please upgrade to greenlet 2 if you're using Python 3.11.
Fix a potential crash due to a reference counting error when Python subclasses of greenlet.greenlet were deallocated. The crash became more common on
Fix a potential crash due to a reference counting error when Python subclasses of greenlet.greenlet were deallocated. The crash became more common on Python 3.10; on earlier versions, silent memory corruption could result. See issue 245. Patch by fygao-wish.
Fix a leak of a list object when the last reference to a greenlet was deleted from some other thread than the one to which it belonged. For this to work correctly, you must call a greenlet API like getcurrent() before the thread owning the greenlet exits: this is a long-standing limitation that can also lead to the leak of a thread's main greenlet if not called; we hope to lift this limitation. Note that in some cases this may also fix leaks of greenlet objects themselves. See issue 251.
Python 3.10: Tracing or profiling into a spawned greenlet didn't work as expected. See issue 256, reported by Joe Rickerby.
Provide Windows binary wheels for Python 3.10 (64-bit only).
Provide Windows binary wheels for Python 3.10 (64-bit only).
Update Python 3.10 wheels to be built against 3.10rc1, where applicable.
Add support for Python 3.10. Pre-built binary wheels for 3.10 are not currently available for all platforms. The greenlet ABI is different on Python 3
Add support for Python 3.10. Pre-built binary wheels for 3.10 are not currently available for all platforms. The greenlet ABI is different on Python 3.10 from all previous versions, but as 3.10 was never supported before, and the ABI has not changed on other Python versions, this is not considered a reason to change greenlet's major version.
Fix %s and %r formatting of a greenlet on Python 2. Previously it would result in a Unicode string instead of a native string. See issue 218 _.
Fix %s and %r formatting of a greenlet on Python 2. Previously it would result in a Unicode string instead of a native string. See issue 218.
Move continuous integration from Travis CI to Github Actions.
(C API) The undocumented GREENLET_VERSION macro that defined a string giving the greenlet version is now deprecated and will not be updated.
Add the ability to set a greenlet's PEP 567 contextvars context directly, by assigning to the greenlet's gr_context attribute. This restores support for some patterns of using greenlets atop an async environment that became more challenging in 0.4.17. Thanks to Joshua Oreman, Mike bayer, and Fantix King, among others. See PR 198.
The repr of greenlet objects now includes extra information about its state. This is purely informative and the details are subject to change. See issue 215.
The greenlet module is now a package. There are no API changes, so all existing imports, including from C code, should continue to work.
(C API) The undocumented GREENLET_VERSION macro that defined a string giving the greenlet version is now deprecated and will not be updated.
(Documentation) Publish the change log to https://greenlet.readthedocs.io
Drop support for Python 2.4, 2.5, 2.6, 3.0, 3.1, 3.2 and 3.4. The project metadata now includes the python_requires data to help installation tools understand supported versions.
Add partial support for AIX ppc64 and IBM i. Thanks to Jesse Gorzinski and Kevin Adler. See PR 197.
Require setuptools to build from source.
Stop asking setuptools to build both .tar.gz and .zip sdists. PyPI has standardized on .tar.gz for all platforms.
Stop using a custom distutils command to build extensions. distutils is deprecated.
Remove the ability to use the deprecated command python setup.py test. Run greenlet tests with your favorite unittest-compatible test runner, e.g., python -m unittest discover greenlet.tests. See issue 185.
The directory layout and resulting sdists have changed. See issue 184.
greenlet is now always built with support for tracing and garbage collection, and, on Python 3.7 and above, support for context variables. The internal and undocumented C preprocessor macros that could be used to alter that at compile time have been removed (no combination other than the defaults was ever tested). This helps define a stable ABI.
Support for PEP 567 ContextVars
Support for PEP 567 ContextVars
Support for DEC Alpha architecture
Support for DEC Alpha architecture
Support for Python 3.9
Support for Python 3.10a0
Support for RISC-V architecture
Support for RISC-V architecture
Workaround a gcc bug on ppc64
- Support for C-SKY architecture - Fixed support for ppc64 ABI - Fixed support for Python 3.7
Support for C-SKY architecture
Fixed support for ppc64 ABI
Fixed support for Python 3.7
- Support for Python 3.7 - Support for MinGW x64
Support for Python 3.7
Support for MinGW x64
- Stop using trashcan api
Stop using trashcan api
- Fixes for aarch64 architecture
Fixes for aarch64 architecture
Added missing files to manifest
Added missing files to manifest
Added workaround for ppc32 on Linux
Start building binary manylinux1 wheels
- Fixed Windows builds
Fixed Windows builds
Added a missing workaround for return 0 on mips
Added a missing workaround for return 0 on mips
Restore compatibility with Python 2.5
Fixed stack switching on sparc
Expose _stack_saved property on greenlet objects, it may be used to introspect the amount of memory used by a saved stack, but the API is subject to c
Expose _stack_saved property on greenlet objects, it may be used to introspect the amount of memory used by a saved stack, but the API is subject to change in the future
Added a workaround for return 0 compiler optimizations on all architectures
C API typo fixes
Fixed several bugs in greenlet C API
Fixed several bugs in greenlet C API
Fixed a bug in multi-threaded applications, which manifested itself with spurious "cannot switch to a different thread" exceptions
Fixed some crashes on arm and mips architectures
Fixed PyGreenlet_SetParent signature, thanks to BoonsNaibot
Fixed PyGreenlet_SetParent signature, thanks to BoonsNaibot
Fixed 64-bit Windows builds depending on wrong runtime dll
Remove deprecated -fno-tree-dominator-opts compiler switch
Better slp_switch performance on SPARC
Drop support for Python 2.3
Fix trashcan assertions on debug builds of Python
Remove deprecated -fno-tree-dominator-opts compiler switch
Enable switch code for SunStudio on 32-bit SunOS
Support for abc abstract methods in greenlet subclasses
Support custom directories for tests
Document switch tracing support
Fix 'err' may be used uninitialized in this function
Add .travis.yml
Fix 'err' may be used uninitialized in this function
Check _MSC_VER for msvc specific code
Fix slp_switch on SPARC for multi-threaded environments
Add support for m68k
Your coding agent can read these notes before it upgrades. Set up the MCP server →