Releases: gevent/gevent
Releases · gevent/gevent
1.2.2
1.1.2
- Python 2:
sendall
on a non-blocking socket could spuriously fail
with a timeout. - If
sys.stderr
has been monkey-patched (not recommended),
exceptions that the hub reports aren't lost and can still be caught.
Reported in :issue:825
by Jelle Smet. - :class:
selectors.SelectSelector
is properly monkey-patched
regardless of the order of imports. Reported in :issue:835
by
Przemysław Węgrzyn. - Python 2:
reload(site)
no longer fails with aTypeError
if
gevent has been imported. Reported in :issue:805
by Jake Hilton.
1.1.1
1.1.1 (Apr 4, 2016)
- Nested callbacks that set and clear an Event no longer cause
wait
to return prematurely. Reported in :issue:771
by Sergey
Vasilyev. - Fix build on Solaris 10. Reported in :issue:
777
by wiggin15. - The
ref
parameter to :func:gevent.os.fork_and_watch
was being ignored. - Python 3: :class:
gevent.queue.Channel
is now correctly iterable, instead of
raising a :exc:TypeError
. - Python 3: Add support for :meth:
socket.socket.sendmsg
,
:meth:socket.socket.recvmsg
and :meth:socket.socket.recvmsg_into
on platforms where they are defined. Initial :pr:773
by Jakub
Klama.
1.1.0
- Python 3: A monkey-patched :class:
threading.RLock
now properly
blocks (or deadlocks) inacquire
if the default value for
timeout of -1 is used (which differs from gevent's default of
None). Theacquire
method also raises the same :exc:ValueError
exceptions that the standard library does for invalid parameters.
Reported in #750 by Joy Zheng. - Fix a race condition in :class:
~gevent.event.Event
that made it
returnFalse
when the event was set and cleared by the same
greenlet before allowing a switch to already waiting greenlets. (Found
by the 3.4 and 3.5 standard library test suites; the same as Python
bug 13502
_. Note that the Python 2 standard library still has this
race condition.) - :class:
~gevent.event.Event
and :class:~.AsyncResult
now wake
waiting greenlets in the same (unspecified) order. Previously,
AsyncResult
tended to use a FIFO order, but this was never
guaranteed. Both classes also use less per-instance memory. - Using a :class:
~logging.Logger
as a :mod:pywsgi
error or request
log stream no longer produces extra newlines. Reported in
#756 by ael-code. - Windows: Installing from an sdist (.tar.gz) on PyPI no longer
requires having Cython installed first. (Note that the binary installation
formats (wheels, exes, msis) are preferred on Windows.) Reported in
#757 by Ned Batchelder. - Issue a warning when :func:
~gevent.monkey.patch_all
is called with
os
set to False (not the default) butsignal
is still True
(the default). This combination of parameters will cause signal
handlers forSIGCHLD
to not get called. In the future this might
raise an error. Reported by Josh Zuech. - Issue a warning when :func:
~gevent.monkey.patch_all
is called more
than once with different arguments. That causes the cumulative set of all True
arguments to be patched, which may cause unexpected results. - Fix returning the original values of certain
threading
attributes from :func:gevent.monkey.get_original
.
1.1rc5
- SSL: Attempting to send empty data using the
:meth:~socket.socket.sendall
method of a gevent SSL socket that has
a timeout now returns immediately (like the standard library does),
instead of incorrectly raising :exc:ssl.SSLEOFError
. (Note that
sending empty data with the :meth:~socket.socket.send
method does raiseSSLEOFError
in
both gevent and the standard library.) Reported in #719 by
Mustafa Atik and Tymur Maryokhin, with a reproducible test case
provided by Timo Savola.
1.1rc4
- Python 2: Using the blocking API at import time when multiple greenlets are also importing should not lead to LoopExit. Reported in issue #728 by Garrett Heel.
- Python 2: Don’t raise
OverflowError
when using thereadline
method of the WSGI input stream without a size hint or with a large size hint when the client is uploading a large amount of data. (This only impacted CPython 2; PyPy and Python 3 already handled this.) Reported in issue #289 by ggjjlldd, with contributions by Nathan Hoad. - BaseServer and its subclasses like WSGIServer avoid allocating a new closure for each request, reducing overhead.
- Python 2: Under 2.7.9 and above (or when the PEP 466 SSL interfaces are available), perform the same hostname validation that the standard library does; previously some cases were ignored. Also, reading, writing, or handshaking a closed
SSLSocket
now raises the same ValueError the standard library does, instead of anAttributeError
. Found by updating gevent’s copy of the standard library test cases. Initially reported in issue #735 by Dmitrij D. Czarkoff. - Python 3: Fix SSLSocket.unwrap and SNI callbacks. Also raise the correct exceptions for unconnected SSL sockets and properly validate SSL hostnames.
- Python 3.5: Add support for
socket.sendfile
. - Python 3.4+: Add support for
socket.get/set_inheritable
.
1.1rc3
- Support the new PEP 466 ssl interfaces on any Python 2 version that supplies them, not just on the versions it officially shipped with. Some Linux distributions, including RedHat/CentOS and Amazon have backported the changes to older versions. Reported in issue #702.
- PyPy: An interaction between Cython compiled code and the garbage collector caused PyPy to crash when a previously-allocated Semaphore was used in a del method, something done in the popular libraries requests and urllib3. Due to this and other Cython related issues, the Semaphore class is no longer compiled by Cython. This means that it is now traceable and not exactly as atomic as the Cython version, though the overall semantics should remain the same. Reported in issue #704 by Shaun Crampton.
- PyPy: Optimize the CFFI backend to use less memory (two pointers per watcher).
- Python 3: The WSGI PATH_INFO entry is decoded from URL escapes using latin-1, not UTF-8. This improves compliance with PEP 333 and compatibility with some frameworks like Django. Fixed in pull request #712 by Ruben De Visscher.
1.1rc2
- Exceptions raised by gevent’s SSL sockets are more consistent with the standard library (e.g., gevent’s Python 3 SSL sockets raise socket.timeout instead of ssl.SSLError, a change introduced in Python 3.2).
- Python 2: gevent’s socket’s sendall method could completely ignore timeouts in some cases. The timeout now refers to the total time taken by sendall.
- gevent’s SSL socket’s sendall method should no longer raise SSL3_WRITE_PENDING in rare cases when sending large buffers. Reported in issue #317.
- gevent.signal now allows resetting (SIG_DFL) and ignoring (SIG_IGN) the SIGCHLD signal at the process level (although this may allow race conditions with libev child watchers). Reported in issue #696 by Adam Ning.
- gevent.spawn_raw() now accepts keyword arguments, as previously (incorrectly) documented. Reported in issue #680 by Ron Rothman.
- PyPy: PyPy 2.6.1 or later is now required (4.0.1 or later is recommended).
- The CFFI backend is now built and usable on CPython implementations (except on Windows) if cffi is installed before gevent is installed. To use the CFFI backend, set the environment variable GEVENT_CORE_CFFI_ONLY before starting Python. This can aid debugging in some cases and helps ensure parity across all combinations of supported platforms.
- The CFFI backend now calls the callback of a watcher whose args attribute is set to None, just like the Cython backend does. It also only allows args to be a tuple or None, again matching the Cython backend.
- PyPy/CFFI: Fix a potential crash when using stat watchers.
- PyPy/CFFI: Encode unicode paths for stat watchers using sys.getfilesystemencoding() like the Cython backend.
- The internal implementation modules gevent._fileobject2, gevent._fileobject3, and gevent._util were removed. These haven’t been used or tested since 1.1b1.
1.1rc1
- Windows/Python 3: Finish porting the gevent.subprocess module, fixing a large number of failing tests. Examples of failures are in issue #668 and issue #669 reported by srossross.
- Python 3: The SSLSocket class should return an empty bytes object on an EOF instead of a str. Fixed in pull request #674 by Dahoon Kim.
- Python 2: Workaround a buffering bug in the stdlib io module that caused FileObjectPosix to be slower than necessary in some cases. Reported in issue #675 by WGH-.
- PyPy: Fix a crash. Reported in issue #676 by Jay Oster.
Caution There are some remaining, relatively rare, PyPy crashes, but their ultimate cause is unknown (gevent, CFFI, greenlet, the PyPy GC?). PyPy users can contribute to issue #677 to help track them down.
PyPy: Exceptions raised while handling an error raised by a loop callback function behave like the CPython implementation: the exception is printed, and the rest of the callbacks continue processing. - If a Hub object with active watchers was destroyed and then another one created for the same thread, which itself was then destroyed with destroy_loop=True, the process could crash. Documented in issue #237 and fix based on pull request #238, both by Jan-Philip Gehrcke.
- Python 3: Initializing gevent’s hub for the first time in a native background thread created during import could fail with AttributeError and ImportError. Reported in issue #687 by Gregory Petukhov.
1.1b6
- PyPy: Fix a memory leak for code that allocated and disposed of many
:class:gevent.lock.Semaphore
subclasses. If monkey-patched, this could
also apply to :class:threading.Semaphore
objects. Reported in
:issue:660
by Jay Oster. - PyPy: Cython version 0.23.4 or later must be used to avoid a memory
leak (details
_). Thanks to Jay Oster. - Allow subclasses of :class:
~.WSGIHandler
to handle invalid HTTP client
requests. Reported by not-bob. - :class:
~.WSGIServer
more robustly supports :class:~logging.Logger
-like parameters for
log
anderror_log
(as introduced in 1.1b1, this could cause
integration issues with gunicorn). Reported in :issue:663
by Jay
Oster. - :class:
~gevent.threading._DummyThread
objects, created in a
monkey-patched system when :func:threading.current_thread
is
called in a new greenlet (which often happens implicitly, such as
when logging) are much lighter weight. For example, they no longer
allocate and then delete a :class:~gevent.lock.Semaphore
, which is
especially important for PyPy. - Request logging by :mod:
gevent.pywsgi
formats the status code
correctly on Python 3. Reported in :issue:664
by Kevin Chen. - Restore the ability to take a weak reference to instances of exactly
:class:gevent.lock.Semaphore
, which was unintentionally removed
as part of makingSemaphore
atomic on PyPy on 1.1b1. Reported in
:issue:666
by Ivan-Zhu. - Build Windows wheels for Python 3.5. Reported in :pr:
665
by Hexchain Tong.