Testing on Python 3.5 now uses Python 3.5.3 due to SSL changes. See issue #943.
Linux CI has been updated from Ubuntu 12.04 to Ubuntu 14.04 since the former has reached EOL.
Linux CI now tests on PyPy2 5.7.1, updated from PyPy2 5.6.0.
Linux CI now tests on PyPy3 3.5-5.7.1-beta, updated from PyPy3 3.3-5.5-alpha.
Python 2 sockets are compatible with the SOCK_CLOEXEC
flag found
on Linux. They no longer pass the socket type or protocol to
getaddrinfo
when connect
is called. Reported in issue #944
by Bernie Hackett.
Replace optparse
module with argparse
. See issue #947.
Update to version 1.3.1 of tblib
to fix issue #954,
reported by ml31415.
Fix the name of the type
parameter to
gevent.socket.getaddrinfo()
to be correct on Python 3. This
would cause callers using keyword arguments to raise a TypeError
.
Reported in issue #960 by js6626069. Likewise, correct the
argument names for fromfd
and socketpair
on Python 2,
although they cannot be called with keyword arguments under CPython.
Note
The gethost*
functions take different argument names
under CPython and PyPy. gevent follows the CPython
convention, although these functions cannot be called with
keyword arguments on CPython.
The previously-singleton exception objects FileObjectClosed
and
cancel_wait_ex
were converted to classes. On Python 3, an
exception object is stateful, including references to its context
and possibly traceback, which could lead to objects remaining alive
longer than intended.
Make sure that python -m gevent.monkey <script>
runs code in the
global scope, not the scope of the main
function. Fixed in
pull request #975 by Shawn Bohrer.
socket.socketpair
for all Python 3 versions.
This was added to Python 3.5, but tests were only added in 3.6.
(For versions older than 3.4 this is a gevent extension.) Previously
this was not supported on any Python 3 version.subprocess.STARTUPINFO
in subprocess.__all__
for 3.6 compatibility._DummyThread
objects created by calling
threading.current_thread()
from inside a raw
greenlet.greenlet
in a system with monkey-patched
threading
now clean up after themselves when the
greenlet dies (gevent.Greenlet
-based _DummyThreads
have
always cleaned up). This requires the use of a weakref.ref
(and may not be timely on PyPy).
Reported in issue #918 by frozenoctobeer.-D_DARWIN_FEATURE_CLOCK_GETTIME=0
for
compatibility with OS X releases before 10.12 Sierra. Reported by
Ned Batchelder in issue #916.MAKE
environment variable to specify the make command
on non-Windows systems for ease of development on BSD systems where
make
is BSD make and gmake
is GNU make (gevent requires GNU
make). See issue #888.gevent.server.StreamServer
accept an SSLContext
on
Python versions that support it. Added in pull request #904 by Arcadiy Ivanov.gevent.coros
which was replaced by gevent.lock
and has been deprecated since 1.0b2.gevent.corecext
and
gevent.corecffi
have been moved. Please import from
gevent.core
instead; this has always been the only documented place to
import from./bin/sh
into the configuration command
line, instead relying on sh
being on the PATH
, as
recommended by the standard.
Fixed in pull request #809 by Fredrix Fornwall.gevent.pywsgi
now checks that the values passed to
start_response
do not contain a carriage return or newline in
order to prevent HTTP response splitting (header injection), raising
a ValueError
if they do. See issue #775.WSGIHandler
no
longer print the entire WSGI environment by default. This avoids
possible information disclosure vulnerabilities. Applications can
also opt-in to a higher security level for the WSGI environment if they
choose and their frameworks support it. Originally reported
in pull request #779 by sean-peters-au and changed in pull request #781.session
parameter, though
this parameter isn’t useful prior to 3.6.gevent.os
, gevent.signal
and
gevent.select
export all the attributes from their
corresponding standard library counterpart.reload(site)
no longer fails with a TypeError
if
gevent has been imported. Reported in issue #805 by Jake Hilton.sendall
on a non-blocking socket could spuriously fail
with a timeout.gevent.select.select()
is given a negative timeout
argument, raise an exception like the standard library does.gevent.select.select()
is given closed or invalid
file descriptors in any of its lists, raise the appropriate
EBADF
exception like the standard library does. Previously,
libev would tend to return the descriptor as ready. In the worst
case, this adds an extra system call, but may also reduce latency if
descriptors are ready at the time of entry.selectors.SelectSelector
is properly monkey-patched
regardless of the order of imports. Reported in issue #835 by
Przemysław Węgrzyn.gevent.select.poll.unregister()
raises an exception if fd is not
registered, like the standard library.gevent.select.poll.poll()
returns an event with
POLLNVAL
for registered fds that are invalid. Previously it
would tend to report both read and write events.FileObjectPosix
exposes the read1
method when in read mode,
and generally only exposes methods appropriate to the mode it is in.FileObjectPosix
supports a bufsize of 0 in binary write modes.
Reported in issue #840 by Mike Lang.gevent.socket.connect_ex()
was letting
BlockingIOError
(and possibly others) get raised instead of
returning the errno due to the refactoring of the exception
hierarchy in Python 3.3. Now the errno is returned. Reported in
issue #841 by Dana Powers.Group
and Pool
now return whether
join()
returned with an empty group. Suggested by Filippo Sironi in
pull request #503.PriorityQueue
now ensures that an initial items list is a
valid heap. Fixed in pull request #793 by X.C.Dong.gevent.hub.signal
(aka gevent.signal()
) now verifies
that its handler
argument is callable, raising a TypeError
if it isn’t. Reported in issue #818 by Peter Renström.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.gevent.os.waitpid()
function is cooperative in more
circumstances. Reported in issue #878 by Heungsub Lee.FileObject
implementations are more consistent with
each other. Note: Writing to the io property of a FileObject should be
considered deprecated.stop
method.gevent.threadpool.ThreadPoolExecutor
(a
concurrent.futures.ThreadPoolExecutor
variant that always
uses native threads even when the system has been monkey-patched)
on platforms that have concurrent.futures
available (Python 3 and Python 2 with the futures
backport
installed). This is helpful for, e.g., grpc. Reported in
issue #786 by Markus Padourek.LoopExit
error. Reported in issue #747 by Sergey Vasilyev.gevent.ssl.get_server_certificate()
would raise a ValueError
if the system wasn’t monkey-patched.
Reported in issue #801 by Gleb Dubovik.TypeError
instead of a
ValueError
. Reported in issue #800 by Kevin Chen.gevent.subprocess
had been used previously could not be reversed, causing
Popen.wait
and other calls to hang. Now, if SIGCHLD has been
ignored, the next time gevent.subprocess
is used this will be
detected and corrected automatically. (This potentially leads to
issues with os.popen()
on Python 2, but the signal can always
be reset again. Mixing the low-level process handling calls,
low-level signal management and high-level use of
gevent.subprocess
is tricky.) Reported in issue #857 by
Chris Utz.Popen.kill
and send_signal
no longer attempt to send signals
to processes that are known to be exited.Several backwards compatible updates to the subprocess module have
been backported from Python 3 to Python 2, making
gevent.subprocess
smaller, easier to maintain and in some cases
safer.
call
, etc) use this for added safety.gevent.subprocess
module now provides the
gevent.subprocess.run()
function in a cooperative way even
when the system is not monkey patched, on all supported versions of
Python. (It was added officially in Python 3.5.)gevent.subprocess.TimeoutExpired
is defined even on Python 2,
where it is a subclass of the gevent.timeout.Timeout
exception; all instances where a Timeout
exception would
previously be thrown under Python 2 will now throw a
TimeoutExpired
exception.gevent.subprocess.call()
(and check_call
) accepts the
timeout keyword argument on Python 2. This is standard on Python
3, but a gevent extension on Python 2.gevent.subprocess.check_output()
accepts the timeout and
input arguments on Python 2. This is standard on Python 3, but a
gevent extension on Python 2.Next page: What’s new in gevent 1.1