Releases: gevent/gevent
Releases · gevent/gevent
1.1b5
- gevent.subprocess works under Python 3.5. In general, Python 3.5 has preliminary support. Reported in issue #653 by Squeaky.
- gevent.subprocess.Popen.communicate honors a timeout argument even if there is no way to communicate with the child process (none of stdin, stdout and stderr were set to PIPE). Noticed as part of the Python 3.5 test suite for the new function subprocess.run but impacts all versions (timeout is an official argument under Python 3 and a gevent extension with slightly different semantics under Python 2).
- Fix a possible ValueError from gevent.queue.Queue:peek. Reported in issue #647 by Kevin Chen.
- Restore backwards compatibility for using gevent.signal as a callable, which, depending on the order of imports, could be broken after the addition of the gevent.signal module. Reported in issue #648 by Sylvain Zimmer.
- gevent blocking operations performed at the top-level of a module after the system was monkey-patched under Python 2 could result in raising a LoopExit instead of completing the expected blocking operation. Note that performing gevent blocking operations in the top-level of a module is typically not recommended, but this situation can arise when monkey-patching existing scripts. Reported in issue #651 and issue #652 by Mike Kaplinskiy.
- SIGCHLD and waitpid now work for the pids returned by the (monkey-patched) os.forkpty and pty.fork functions in the same way they do for the os.fork function. Reported in issue #650 by Erich Heine.
- gevent.pywsgi.WSGIServer (WSGIHandler) does a better job detecting and reporting potential encoding errors for headers and the status line during start_response as recommended by the WSGI specification. In addition, under Python 2, unnecessary encodings and decodings (often a trip through the ASCII encoding) are avoided for conforming applications. This is an enhancement of an already documented and partially enforced constraint: beginning in 1.1a1, under Python 2, u'abc' would typically previously have been allowed, but u'\u1f4a3' would not; now, neither will be allowed, more closely matching the specification, improving debugability and performance and allowing for better error handling both by the application and by gevent (previously, certain encoding errors could result in gevent writing invalid/malformed HTTP responses). Reported by Greg Higgins and Carlos Sanchez.
- Code coverage by tests is now reported on coveralls.io.
1.1b4
- Detect and raise an error for several important types of
programming errors even if Python interpreter optimizations are
enabled with-O
orPYTHONOPTIMIZE
. Previously these would go
undetected if optimizations were enabled, potentially leading to
erratic, difficult to debug behaviour. - Fix an
AttributeError
fromgevent.queue.Queue
whenpeek
was called on an emptyQueue
. Reported in #643 by michaelvol. - Make
SIGCHLD
handlers specified tosignal.signal
work with
the child watchers that are used by default. Also make
os.waitpid
work with a first argument of -1. Noted by users of gunicorn. - Under Python 2, any timeout set on a socket would be ignored when
using the results ofsocket.makefile
. Reported in #644
by Karan Lyons.
1.1b3
- Fix an
AttributeError
fromgevent.monkey.patch_builtins
on
Python 2 when thefuture
_ library is also installed. Reported by
Carlos Sanchez. - PyPy: Fix a
DistutilsModuleError
orImportError
if the CFFI
module backinggevent.core
needs to be compiled when the hub is
initialized (due to a missing or invalid__pycache__
directory).
Now, the module will be automtically compiled when gevent is
imported (this may produce compiler output on stdout). Reported in
:issue:619
by Thinh Nguyen and :issue:631
by Andy Freeland, with
contributions by Jay Oster and Matt Dupre. - PyPy: Improve the performance of
gevent.socket.socket:sendall
with large inputs.bench_sendall.py
_ now performs about as well on
PyPy as it does on CPython, an improvement of 10x (from ~60MB/s to
~630MB/s). See thispypy bug
_ for details. - Fix a possible
TypeError
when callinggevent.socket.wait
.
Reported in #635 by lanstin. gevent.socket.socket:sendto
properly respects the socket's
blocking status (meaning it can raise EWOULDBLOCK now in cases it
wouldn't have before). Reported in :pr:634
by Mike Kaplinskiy.- Common lookup errors using the :mod:
threaded resolver <gevent.resolver_thread>
are no longer always printed to stderr
since they are usually out of the programmer's control and caught
explicitly. (Programming errors likeTypeError
are still
printed.) Reported in :issue:617
by Jay Oster and Carlos Sanchez. - PyPy: Fix a
TypeError
fromgevent.idle()
. Reported in
:issue:639
by chilun2008. - The
imap_unordered
methods of a pool support amaxsize
parameter to limit the number of results buffered waiting for the
consumer. Reported in :issue:638
by Sylvain Zimmer. - The class
gevent.queue.Queue
now consistently orders multiple
blocked waitingput
andget
callers in the order they
arrived. Previously, due to an implementation quirk this was often
roughly the case under CPython, but not under PyPy. Now they both
behave the same. - The class
gevent.queue.Queue
now supports thelen()
function.
1.1b2
- Enable the c-ares resolver extension for PyPy.
- On some versions of PyPy on some platforms (notably 2.6.0 on 64-bit
Linux), enablinggevent.monkey.patch_builtins
could cause PyPy
to crash. Reported in #618 by Jay Oster. gevent.kill
raises the correct exception in the target greenlet.
Reported in #623 by Jonathan Kamens.- Various fixes on Windows. Reported in #625, #627,
and #628 by jacekt and Yuanteng (Jeff) Pei. Fixed in #624. - Add
readable
andwritable
methods toFileObjectPosix
;
this fixes e.g., help() on Python 3 when monkey-patched.
1.1b1
setup.py
can be run from a directory containing spaces. Reported
in :issue:319
by Ivan Smirnov.setup.py
can build with newer versions of clang on OS X. They
enforce the distinction between CFLAGS and CPPFLAGS.gevent.lock.Semaphore
is atomic on PyPy, just like it is on
CPython. This comes at a small performance cost.- Fixed regression that failed to set the
successful
value to
False when killing a greenlet before it ran with a non-default
exception. Fixed in :pr:608
by Heungsub Lee. - libev's child watchers caused
os.waitpid
to become unreliable
due to the use of signals on POSIX platforms. This was especially
noticeable when usinggevent.subprocess
in combination with
multiprocessing
. Now, the monkey-patchedos
module provides
awaitpid
function that seeks to ameliorate this. Reported in
:issue:600
by champax and :issue:452
by Łukasz Kawczyński. - On platforms that implement
select.poll
, provide a
gevent-friendlygevent.select.poll
and corresponding
monkey-patch. Implemented in :pr:604
by Eddi Linder. - Allow passing of events to the io callback under PyPy. Reported in
:issue:531
by M. Nunberg and implemented in :pr:604
. gevent.thread.allocate_lock
(and so a monkey-patched standard
libraryallocate_lock
) more closely matches the behaviour of the
builtin: an unlocked lock cannot be released, and attempting to do
so throws the correct exception (thread.error
on Python 2,
RuntimeError
on Python 3). Previously, over-releasing a lock was
silently ignored. Reported in :issue:308
by Jędrzej Nowak.gevent.fileobject.FileObjectThread
uses the threadpool to close
the underling file-like object. Reported in :issue:201
by
vitaly-krugl.- Malicious or malformed HTTP chunked transfer encoding data sent to
thegevent.pywsgi
handler is handled more robustly, resulting in
"HTTP 400 bad request" responses instead of a 500 error or, in the
worst case, a server-side hang. Reported in :issue:229
by Björn
Lindqvist. - Importing the standard library
threading
module before using
gevent.monkey.patch_all()
no longer causes Python 3.4 to fail to
get therepr
of the main thread, and other CPython platforms to
return an unjoinable DummyThread. (Note that this is not
recommended.) Reported in :issue:153
. - Under Python 2, use the
io
package to implement
FileObjectPosix
. This unifies the code with the Python 3
implementation, and fixes problems with usingseek()
. See
:issue:151
. - Under Python 2, importing a module that uses gevent blocking
functions at its top level from multiple greenlets no longer
produces import errors (Python 3 handles this case natively).
Reported in :issue:108
by shaun and initial fix based on code by
Sylvain Zimmer. gevent.spawn
,spawn_raw
andspawn_later
, as well as the
Greenlet
constructor, immediately produce usefulTypeError
s
if asked to run something that cannot be run. Previously, the
spawned greenlet would die with an uncaughtTypeError
the first
time it was switched to. Reported in :issue:119
by stephan.- Recursive use of
gevent.threadpool.ThreadPool.apply
no longer
raises aLoopExit
error (usingThreadPool.spawn
and then
get
on the result still could; you must be careful to use the
correct hub). Reported in :issue:131
by 8mayday. - When the
threading
module is monkey-patched, the module-level
lock in thelogging
module is made greenlet-aware, as are the
instance locks of any configured handlers. This makes it safer to
import modules that use the standard pattern of creating a
module-levelLogger
instance before monkey-patching. Configuring
logging
with a basic configuration and then monkey-patching is
also safer (but not configurations that involve such things as the
SocketHandler
). - Fix monkey-patching of
threading.RLock
under Python 3. - Under Python 3, monkey-patching at the top-level of a module that
was imported by another module could result in aRuntimeError
fromimportlib
. Reported in :issue:615
by Daniel Mizyrycki.
(The same thing could happen under Python 2 if athreading.RLock
was held around the monkey-patching call; this is less likely but
not impossible with import hooks.) - Fix configuring c-ares for a 32-bit Python when running on a 64-bit
platform. Reported in :issue:381
and fixed in :pr:616
by Chris
Lane. - (Experimental) Let the
pywsgi.WSGIServer
accept a
logging.Logger
instance for itslog
and (new)error_log
parameters. Take care that the system is fully monkey-patched very
early in the process's lifetime if attempting this, and note that
non-file handlers have not been tested. Fixes :issue:106
.
1.1a2
gevent.threadpool.ThreadPool.imap
andimap_unordered
now
accept multiple iterables.- (Experimental) Exceptions raised from iterating using the
ThreadPool
orGroup
mapping/application functions should now
have the original traceback. gevent.threadpool.ThreadPool.apply
now raises any exception
raised by the called function, the same as
gevent.pool.Group
/Pool
and the builtinapply
function.
This obsoletes the undocumentedapply_e
function. Original PR
#556 by Robert Estelle.- Monkey-patch the
selectors
module frompatch_all
and
patch_select
on Python 3.4. See #591 . - Additional query functions for the :mod:
gevent.monkey
module
allow knowing what was patched. Discussed in :issue:135
and
implemented in :pr:325
by Nathan Hoad. - In non-monkey-patched environments under Python 2.7.9 or above or
Python 3, using a gevent SSL socket could cause the greenlet to
block. See :issue:597
by David Ford. gevent.socket.socket.sendall
supports arbitrary objects that
implement the buffer protocol (such as ctypes structures), just like
native sockets. Reported in :issue:466
by tzickel.- Added support for the
onerror
attribute present in CFFI 1.2.0
for better signal handling under PyPy. Thanks to Armin Rigo and Omer
Katz. (See https://bitbucket.org/cffi/cffi/issue/152/handling-errors-from-signal-handlers-in) - The
gevent.subprocess
module is closer in behaviour to the
standard library under Python 3, at least on POSIX. The
pass_fds
,restore_signals
, andstart_new_session
arguments are now unimplemented, as are thetimeout
parameters
to various functions. Under Python 2, the previously undocumentedtimeout
parameter toPopen.communicate
raises an exception like its
Python 3 counterpart. - An exception starting a child process with the
gevent.subprocess
module no longer leaks file descriptors. Reported in :pr:374
by 陈小玉. - The example
echoserver.py
no longer binds to the standard X11
TCP port. Reported in :issue:485
by minusf. gevent.iwait
no longer throwsLoopExit
if the caller
switches greenlets between return values. Reported and initial patch
in :pr:467
by Alexey Borzenkov.- The default threadpool and default threaded resolver work in a
forked child process, such as withmultiprocessing.Process
.
Previously the child process would hang indefinitely. Reported in
:issue:230
by Lx Yu. - Fork watchers are more likely to (eventually) get called in a
multi-threaded program. gevent.killall
accepts an arbitrary iterable for the greenlets
to kill. Reported in :issue:404
by Martin Bachwerk; seen in
combination with older versions of simple-requests.gevent.local.local
objects are now eligible for garbage
collection as soon as the greenlet finishes running, matching the
behaviour of the built-inthreading.local
(when implemented
natively). Reported in :issue:387
by AusIV.- Killing a greenlet (with
gevent.kill
or
gevent.greenlet.Greenlet.kill
) before it is actually started and
switched to now prevents the greenlet from ever running, instead of
raising an exception when it is later switched to. See :issue:330
reported by Jonathan Kamens.
1.1a1
See the changelog for a detailed list of changes.
gevent 1.0.2 final
See https://github.com/gevent/gevent/blob/1.0.2/changelog.rst#release-102-may-23-2015 for a list of changes.
gevent 1.0.1 final
See https://github.com/surfly/gevent/blob/1.0.x/changelog.rst#release-101-apr-30-2014 for list of changes
gevent 1.0 final
Final version of gevent 1.0.