gevent / changelog.rst

Full commit


Release 1.0a1

TODO: - gevent.http? - gevent.httplib? - gevent.wsgi? (Currently gevent/ imports classes from gevent/

Backward-incompatible changes:

Release highlights:

  • The :mod:`gevent.core` module now wraps libev's API and is not compatible with gevent 0.x.
  • Added a concept of pluggable event loops. By default gevent.core.loop is used, which is a wrapper around libev.
  • Added a concept of pluggable name resolvers. By default a resolver based on c-ares library is used.
  • Added support for multiple OS threads, each new thread will get its own Hub instance with its own event loop.
  • The release now includes and embeds the dependencies: libev and c-ares.
  • The standard :mod:`signal` works now as expected.
  • The unhandled errors are now handled uniformely by Hub.handle_error function.
  • Added :class:`Channel` class to :mod:`gevent.queue` module. It is equivalent to Queue(0) in gevent 0.x, which is deprecated now.
  • Added method :meth:`peek` to :class:`Queue` class.
  • Added :func:`idle` function which blocks until the event loop is idle.
  • Added a way to gracefully shutdown the application by waiting for all outstanding greenlets/servers/watchers: :meth:`Hub.join`.
  • Added new :mod:`gevent.ares` C extension which wraps c-ares and provides asynchronous DNS resolver.
  • Added new :mod:`gevent.resolver_ares` module provides synchronous API on top of :mod:`gevent.ares`.

The :mod:`gevent.socket` module:

  • DNS functions now use c-ares library rather than libevent-dns. This fixes a number of problems with name resolving: - Issue #2: DNS resolver no longer breaks after fork(). You still need to call :func:`gevent.fork` (os.fork is monkey

    patched with it if monkey.patch_all() was called).

    • DNS resolver no longer ignores /etc/resolv.conf and /etc/hosts.
  • The following functions were added to socket module - gethostbyname_ex - getnameinfo - gethostbyaddr - getfqdn

  • Removed undocumented bind_and_listen and tcp_listener

The :class:`Hub` object:

  • Added :meth:`join` method which waits until the event loop exits or optional timeout expires.
  • Added :meth:`wait` method which waits until a watcher has got an event.
  • Added :meth:`handle_error` method which is called by all of gevent in case of unhandled exception.
  • Added :meth:`print_exception` method which is called by handle_error to print the exception traceback.

The :class:`Greenlet` objects:

  • Added __nonzero__ implementation that returns True after greenlet was started until it's dead. Previously greenlet was False after start() until it was first switched to.

The mod:gevent.pool module:

  • It is now possible to add raw greenlets to the pool.
  • The :meth:`map` and :meth:`imap` methods now start yielding the results as soon as possible.
  • The :meth:`imap_unordered` no longer swallows an exception raised while iterating its argument.


  • gevent.sleep(<negative value>) no longer raises an exception, instead it does sleep(0).
  • Added method clear to internal Waiter class.
  • Removed wait method from internal Waiter class.
  • The :class:`WSGIServer` now sets max_accept to 1 if wsgi.multiprocessing is set to True.
  • Added :func:`monkey.patch_module` function that monkey patches module using __implements__ list provided by gevent module. All of gevent modules that replace stdlib module now have __implements__ attribute.

Release 0.13.6 (May 2, 2011)

  • Added __copy__ method to :class:`gevent.local.local` class that implements copy semantics compatible with built-in threading.local. Patch by Galfy Pundee.
  • Fixed :class:`StreamServer` class to catch EWOULDBLOCK rather than EAGAIN. This fixes lots of spurious tracebacks on Windows where these two constants are not the same. Patch by Alexey Borzenkov.
  • Fixed issue #65: :func:`fork` now calls event_reinit only in the child process; otherwise the process could hang when using libevent2. Patch by Alexander Boudkar.

Release 0.13.5 (Apr 21, 2011)

  • Fixed build problem on Python 2.5

Release 0.13.4 (Apr 11, 2011)

Release 0.13.3 (Feb 7, 2011)

Release 0.13.2 (Jan 28, 2011)

Release 0.13.1 (Sep 23, 2010)

Release highlights:

:mod:`gevent.socket` module:

:mod:`gevent.ssl` module:

  • Imported a number of patches from stdlib by Antoine Pitrou:
    • Calling :meth:`makefile` method on an SSL object would prevent the underlying socket from being closed until all objects get truely destroyed (Python issue #5238).
    • SSL handshake would ignore the socket timeout and block indefinitely if the other end didn't respond (Python issue #5103).
    • When calling :meth:`getpeername` in SSLSocket.__init__, only silence exceptions caused by the "socket not connected" condition.
  • Added support for ciphers argument.
  • Updated SSLSocket.send and SSLSocket.recv methods to match the behavior of stdlib :mod:`ssl` better.
  • Fixed :class:`ssl.SSLObject` to delete events used by other greenlets when closing the instance (issue #34).


  • Made :class:`BaseServer` accept long values as pool argument in addition to int.
  • Made :attr:`http._requests` attribute public.
  • Updated webchat example to use file on disk rather than in-memory sqlite database to avoid :exc:`OperationalError`.
  • Fixed example to be runnable under external WSGI server.
  • Fixed bogus failure in
  • Added new test to check PEP8 conformance:
  • Fixed :class:`BackdoorServer` close the connection on :exc:`SystemExit` and simplified the code.
  • Made :class:`Pool` raise :exc:`ValueError` when initialized with size=0.
  • Updated --libevent to configure and make libevent if it's not built already.
  • Updated to use setuptools if present and add dependency on greenlet.
  • Fixed doc/ to work with Sphinx 1. Thanks by Örjan Persson.

Release 0.13.0 (Jul 14, 2010)

Release highlights:

Backward-incompatible changes:

:mod:`gevent.socket` module:

  • Fixed issues #26 and #34: closing the socket while reading/writing/connecting is now safe. Thanks to Cyril Bay.
  • Imported :func:`getfqdn` from :mod:`socket` module.
  • The module now uses sys.platform to detect Windows rather than :mod:`platform` module.
  • Fixed issue #27: :func:`getaddrinfo` used to handle the case when socktype or proto were equal to 0. Thanks to Randall Leeds.

:mod:`gevent.coros` module:

:mod:`gevent.event` module:

:mod:`gevent.wsgi` module:

:mod:`gevent.pywsgi` module:

:mod:`gevent.core` module:

:mod:`gevent.http` and :mod:`gevent.wsgi` modules:



Thanks to Ralf Schmitt for :mod:`pywsgi`, a number of fixes for :mod:`wsgi`, help with :mod:`baseserver` and :mod:`server` modules, improving and various other patches and suggestions.

Thanks to Uriel Katz for :mod:`pywsgi` patches.

Release 0.12.2 (Mar 2, 2010)

  • Fixed http server to put the listening socket into a non-blocking mode. Contributed by Ralf Schmitt.

Release 0.12.1 (Feb 26, 2010)

  • Removed a symlink from the distribution (that causes pip to fail). Thanks to Brad Clements for reporting it.
  • automatically create symlink from build/lib.../gevent/ to gevent/
  • :mod:`gevent.socket`: Improved compatibility with stdlib's socket:

Release 0.12.0 (Feb 5, 2010)

Release highlights:

:mod:`gevent.wsgi` module:

  • Made env["REMOTE_PORT"] into a string.
  • Fixed the server to close the iterator returned by the application.
  • Made wsgi.input object iterable.

:mod:`gevent.core` module:

  • Made DNS functions no longer accept/return IP addresses in dots-and-numbers format. They work with packed IPs now.
  • Made DNS functions no longer accept additional arguments to pass to the callback.
  • Fixed DNS functions to check the return value of the libevent functions and raise :exc:`IOError` if they failed.
  • Added :func:`core.dns_err_to_string`.
  • Made core.event.cancel not to raise if event_del reports an error. instead, the return code is passed to the caller.
  • Fixed minor issue in string representation of the events.

:mod:`gevent.socket` module:


Release 0.11.2 (Dec 10, 2009)

Release 0.11.1 (Nov 15, 2009)

  • Fixed bug in :func:`` function. Passing non-empty list of write descriptors used to cause this function to fail.
  • Changed to go ahead with the compilation even if the actual version of libevent cannot be determined (version 1.x.x is assumed in that case).

Contributed by Ludvig Ericson:

  • Fixed :mod:`wsgi`'s start_response to recognize exc_info argument.
  • Fixed to look for libevent.dylib rather than .so on Darwin platforms.

Release 0.11.0 (Oct 9, 2009)

Release 0.10.0 (Aug 26, 2009)

The following items were added to the gevent top level package:

The following items were marked as deprecated:

Internally, gevent.greenlet was split into a number of modules:

Thanks to Jason Toffaletti for reporting the installation issue and providing a test case for WSGI double content-length header bug.

Release 0.9.3 (Aug 3, 2009)

  • Fixed all known bugs in the :mod:`gevent.queue` module and made it 2.4-compatible. :class:`LifoQueue` and :class:`PriorityQueue` are implemented as well. :mod:`gevent.queue` will deprecate both coros.Queue and coros.Channel.
  • Fixed :class:`Timeout` to raise itself by default. TimeoutError is gone. Silent timeout is now created by passing False instead of None.
  • Fixed bug in :func:`` where it could silent the wrong timeout.
  • :func:`spawn` and :func:`spawn_later` now avoid creating a closure and this decreases spawning time by 50%.
  • kill's and killall's wait argument was renamed to block. The polling is now implemented by greenlet.join and greenlet.joinall functions and it become more responsive, with gradual increase of sleep time.
  • Renamed proc.RunningProcSet to proc.ProcSet.
  • Added :func:`shutdown` function, which blocks until libevent has finished dispatching the events.
  • The return value of event_add and event_del in core.pyx are now checked properly and :exc:`IOError` is raised if they have failed.
  • Fixed, accidentally broken in the previous release.

Release 0.9.2 (Jul 20, 2009)

Release 0.9.1 (Jul 9, 2009)

  • Fixed compilation with libevent-1.3. Thanks to Litao Wei for reporting the problem.
  • Fixed :class:`Hub` to recover silently after event_dispatch() failures (I've seen this happen after fork even though event_reinit() is called as necessary). The end result is that :func:`fork` now works more reliably, as detected by - it used to fail occasionally, now it does not.
  • Reorganized the package, most of the stuff from gevent/ was moved to gevent/ gevent/ imports some of it back but not everything.
  • Renamed gevent.timeout to :class:`gevent.Timeout`. The old name is available as an alias.
  • Fixed a few bugs in :class:`queue.Queue`. Added from standard tests to check how good is :class:`queue.Queue` a replacement for a standard :mod:`Queue` (not good at all, timeouts in :meth:`queue.Queue.put` don't work yet)
  • :mod:`monkey` now patches ssl module when on 2.6 (very limited support).
  • Improved compatibility with Python 2.6 and Python 2.4.
  • Greenlet installed from PyPI (without py.magic prefix) is properly recognized now.
  • core.pyx was accidentally left out of the source package, it's included now.
  • :class:`GreenSocket <socket.socket>` now wraps a socket object from _socket module rather than from :mod:`socket`.

Release 0.9.0 (Jul 8, 2009)

Started as eventlet 0.8.11 fork, with the intention to support only libevent as a backend. Compared to eventlet, this version has a much simpler API and implementation and a few severe bugs fixed, namely

There's a test in my repo of eventlet that reproduces both of them:

Besides having less bugs and less code to care about the goals of the fork are:

  • Piggy-back on libevent as much as possible (use its http and dns code).
  • Use the interfaces and conventions from the standard Python library where possible.