gevent v1.5.a4 Release Notes

Release Date: 2020-03-23 // about 4 years ago
  • ⚡️ Platform and Packaging Updates

    • ⚡️ Python version updates: gevent is now tested with CPython 3.6.10, 3.7.7 and 3.8.2. It is also tested with PyPy2 7.3 and PyPy 3.6 7.3.

    • The include directories used to compile the C extensions have been tweaked with the intent of making it easier to use older debug versions of Python. See :issue:1461.

    • 📦 The binary wheels and installed package no longer include generated C source files and headers. Also excluded are Cython .pxd files, which were never documented. Please file an issue if you miss these.

    ⚡️ Library and Dependency Updates

    • ⚡️ Upgrade libev from 4.25 to 4.31 and update its embedded config.guess to the latest. See :issue:1504.

    .. important::

     libev, when built with ``EV_VERIFY >= 2``, now performs
     verification of file descriptors when IO watchers are started
     *and* when they are stopped. If you first close a file descriptor
     and only then stop an associated watcher, libev will abort the
     process.
    
     Using the standard gevent socket and file objects handles this
     automatically, but if you're using the IO watchers directly,
     you'll need to watch out for this.
    
     The binary wheels gevent distributes *do not* set ``EV_VERIFY``
     and don't have this issue.
    
    • 👉 Make libuv and libev use the Python memory allocators. This assists with debugging. The event libraries allocate small amounts of memory at startup. The allocation functions have to take the GIL, but because of the limited amount of actual allocation that gets done this is not expected to be a bottleneck.

    • 🚀 Update the bundled tblib library to the unreleased 1.7.0 version. The only change is to add more attributes to Frame and Code objects for pytest compatibility. See :pr:1541.

    Potentially Breaking Changes

    • ✂ Remove the magic proxy object gevent.signal. This served as both a deprecated alias of gevent.signal_handler and the module gevent.signal. This made it confusing to humans and static analysis tools alike. The alias was deprecated since gevent 1.1b4. See :issue:1596.

    Other

    • 👉 Make gevent.subprocess.Popen.communicate raise exceptions raised by reading from the process, like the standard library. In particular, under Python 3, if the process output is being decoded as text, this can now raise UnicodeDecodeError. Reported in :issue:1510 by Ofer Koren.

    • 👉 Make gevent.subprocess.Popen.communicate be more careful about closing files. Previously if a timeout error happened, a second call to communicate might not close the pipe.

    • ➕ Add gevent.contextvars, a cooperative version of contextvars. This is available to all Python versions. On Python 3.7 and above, where contextvars is a standard library module, it is monkey-patched by default. See :issue:1407.

    • 0️⃣ Use selectors.PollSelector as the selectors.DefaultSelector after monkey-patching if select.poll was defined. Previously, gevent replaced it with selectors.SelectSelector, which has a different set of limitations (e.g., on certain platforms such as glibc Linux, it has a hardcoded limitation of only working with file descriptors < 1024). See :issue:1466 reported by Sam Wong.

    • 👉 Make the dnspython resolver work if dns python had been imported before the gevent resolver was initialized. Reported in :issue:1526 by Chris Utz and Josh Zuech.