Recent Releases of gevent
gevent - 1.1.2
- Python 2:
sendallon a non-blocking socket could spuriously fail with a timeout. - If
sys.stderrhas been monkey-patched (not recommended), exceptions that the hub reports aren't lost and can still be caught. Reported in :issue:825by Jelle Smet. - :class:
selectors.SelectSelectoris properly monkey-patched regardless of the order of imports. Reported in :issue:835by Przemysław Węgrzyn. - Python 2:
reload(site)no longer fails with aTypeErrorif gevent has been imported. Reported in :issue:805by Jake Hilton.
- Python
Published by jamadden over 9 years ago
gevent - 1.1.1
1.1.1 (Apr 4, 2016)
- Nested callbacks that set and clear an Event no longer cause
waitto return prematurely. Reported in :issue:771by Sergey Vasilyev. - Fix build on Solaris 10. Reported in :issue:
777by wiggin15. - The
refparameter to :func:gevent.os.fork_and_watchwas being ignored. - Python 3: :class:
gevent.queue.Channelis now correctly iterable, instead of raising a :exc:TypeError. - Python 3: Add support for :meth:
socket.socket.sendmsg, :meth:socket.socket.recvmsgand :meth:socket.socket.recvmsg_intoon platforms where they are defined. Initial :pr:773by Jakub Klama.
- Python
Published by jamadden almost 10 years ago
gevent - 1.1.0
- Python 3: A monkey-patched :class:
threading.RLocknow properly blocks (or deadlocks) inacquireif the default value for timeout of -1 is used (which differs from gevent's default of None). Theacquiremethod also raises the same :exc:ValueErrorexceptions that the standard library does for invalid parameters. Reported in #750 by Joy Zheng. - Fix a race condition in :class:
~gevent.event.Eventthat made it returnFalsewhen 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 Pythonbug 13502_. Note that the Python 2 standard library still has this race condition.) - :class:
~gevent.event.Eventand :class:~.AsyncResultnow wake waiting greenlets in the same (unspecified) order. Previously,AsyncResulttended to use a FIFO order, but this was never guaranteed. Both classes also use less per-instance memory. - Using a :class:
~logging.Loggeras a :mod:pywsgierror 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_allis called withosset to False (not the default) butsignalis still True (the default). This combination of parameters will cause signal handlers forSIGCHLDto not get called. In the future this might raise an error. Reported by Josh Zuech. - Issue a warning when :func:
~gevent.monkey.patch_allis 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
threadingattributes from :func:gevent.monkey.get_original.
- Python
Published by jamadden almost 10 years ago
gevent - 1.1rc5
- SSL: Attempting to send empty data using the
:meth:
~socket.socket.sendallmethod 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.sendmethod does raiseSSLEOFErrorin both gevent and the standard library.) Reported in #719 by Mustafa Atik and Tymur Maryokhin, with a reproducible test case provided by Timo Savola.
- Python
Published by jamadden almost 10 years ago
gevent - 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
OverflowErrorwhen using thereadlinemethod 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
SSLSocketnow 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.
- Python
Published by jamadden about 10 years ago
gevent - 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.
- Python
Published by jamadden about 10 years ago
gevent - 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 SSL3WRITEPENDING in rare cases when sending large buffers. Reported in issue #317.
- gevent.signal now allows resetting (SIGDFL) and ignoring (SIGIGN) 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 GEVENTCORECFFI_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.
- Python
Published by jamadden about 10 years ago
gevent - 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.
- Python
Published by jamadden over 10 years ago
gevent - 1.1b6
- PyPy: Fix a memory leak for code that allocated and disposed of many
:class:
gevent.lock.Semaphoresubclasses. If monkey-patched, this could also apply to :class:threading.Semaphoreobjects. Reported in :issue:660by 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:
~.WSGIHandlerto handle invalid HTTP client requests. Reported by not-bob. - :class:
~.WSGIServermore robustly supports :class:~logging.Logger-like parameters forloganderror_log(as introduced in 1.1b1, this could cause integration issues with gunicorn). Reported in :issue:663by Jay Oster. - :class:
~gevent.threading._DummyThreadobjects, created in a monkey-patched system when :func:threading.current_threadis 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.pywsgiformats the status code correctly on Python 3. Reported in :issue:664by 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 makingSemaphoreatomic on PyPy on 1.1b1. Reported in :issue:666by Ivan-Zhu. - Build Windows wheels for Python 3.5. Reported in :pr:
665by Hexchain Tong.
- Python
Published by jamadden over 10 years ago
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.
- Python
Published by jamadden over 10 years ago
gevent - 1.1b4
- Detect and raise an error for several important types of
programming errors even if Python interpreter optimizations are
enabled with
-OorPYTHONOPTIMIZE. Previously these would go undetected if optimizations were enabled, potentially leading to erratic, difficult to debug behaviour. - Fix an
AttributeErrorfromgevent.queue.Queuewhenpeekwas called on an emptyQueue. Reported in #643 by michaelvol. - Make
SIGCHLDhandlers specified tosignal.signalwork with the child watchers that are used by default. Also makeos.waitpidwork 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 of
socket.makefile. Reported in #644 by Karan Lyons.
- Python
Published by jamadden over 10 years ago
gevent - 1.1b3
- Fix an
AttributeErrorfromgevent.monkey.patch_builtinson Python 2 when thefuture_ library is also installed. Reported by Carlos Sanchez. - PyPy: Fix a
DistutilsModuleErrororImportErrorif the CFFI module backinggevent.coreneeds 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:619by Thinh Nguyen and :issue:631by Andy Freeland, with contributions by Jay Oster and Matt Dupre. - PyPy: Improve the performance of
gevent.socket.socket:sendallwith 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
TypeErrorwhen callinggevent.socket.wait. Reported in #635 by lanstin. gevent.socket.socket:sendtoproperly respects the socket's blocking status (meaning it can raise EWOULDBLOCK now in cases it wouldn't have before). Reported in :pr:634by 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 likeTypeErrorare still printed.) Reported in :issue:617by Jay Oster and Carlos Sanchez. - PyPy: Fix a
TypeErrorfromgevent.idle(). Reported in :issue:639by chilun2008. - The
imap_unorderedmethods of a pool support amaxsizeparameter to limit the number of results buffered waiting for the consumer. Reported in :issue:638by Sylvain Zimmer. - The class
gevent.queue.Queuenow consistently orders multiple blocked waitingputandgetcallers 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.Queuenow supports thelen()function.
- Python
Published by jamadden over 10 years ago
gevent - 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), enabling
gevent.monkey.patch_builtinscould cause PyPy to crash. Reported in #618 by Jay Oster. gevent.killraises 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
readableandwritablemethods toFileObjectPosix; this fixes e.g., help() on Python 3 when monkey-patched.
- Python
Published by jamadden over 10 years ago
gevent - 1.1b1
setup.pycan be run from a directory containing spaces. Reported in :issue:319by Ivan Smirnov.setup.pycan build with newer versions of clang on OS X. They enforce the distinction between CFLAGS and CPPFLAGS.gevent.lock.Semaphoreis atomic on PyPy, just like it is on CPython. This comes at a small performance cost.- Fixed regression that failed to set the
successfulvalue to False when killing a greenlet before it ran with a non-default exception. Fixed in :pr:608by Heungsub Lee. - libev's child watchers caused
os.waitpidto become unreliable due to the use of signals on POSIX platforms. This was especially noticeable when usinggevent.subprocessin combination withmultiprocessing. Now, the monkey-patchedosmodule provides awaitpidfunction that seeks to ameliorate this. Reported in :issue:600by champax and :issue:452by Łukasz Kawczyński. - On platforms that implement
select.poll, provide a gevent-friendlygevent.select.polland corresponding monkey-patch. Implemented in :pr:604by Eddi Linder. - Allow passing of events to the io callback under PyPy. Reported in
:issue:
531by 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.erroron Python 2,RuntimeErroron Python 3). Previously, over-releasing a lock was silently ignored. Reported in :issue:308by Jędrzej Nowak.gevent.fileobject.FileObjectThreaduses the threadpool to close the underling file-like object. Reported in :issue:201by vitaly-krugl.- Malicious or malformed HTTP chunked transfer encoding data sent to
the
gevent.pywsgihandler 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:229by Björn Lindqvist. - Importing the standard library
threadingmodule before usinggevent.monkey.patch_all()no longer causes Python 3.4 to fail to get thereprof 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
iopackage to implementFileObjectPosix. 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:
108by shaun and initial fix based on code by Sylvain Zimmer. gevent.spawn,spawn_rawandspawn_later, as well as theGreenletconstructor, immediately produce usefulTypeErrors if asked to run something that cannot be run. Previously, the spawned greenlet would die with an uncaughtTypeErrorthe first time it was switched to. Reported in :issue:119by stephan.- Recursive use of
gevent.threadpool.ThreadPool.applyno longer raises aLoopExiterror (usingThreadPool.spawnand thengeton the result still could; you must be careful to use the correct hub). Reported in :issue:131by 8mayday. - When the
threadingmodule is monkey-patched, the module-level lock in theloggingmodule 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-levelLoggerinstance before monkey-patching. Configuringloggingwith a basic configuration and then monkey-patching is also safer (but not configurations that involve such things as theSocketHandler). - Fix monkey-patching of
threading.RLockunder Python 3. - Under Python 3, monkey-patching at the top-level of a module that
was imported by another module could result in a
RuntimeErrorfromimportlib. Reported in :issue:615by Daniel Mizyrycki. (The same thing could happen under Python 2 if athreading.RLockwas 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:
381and fixed in :pr:616by Chris Lane. - (Experimental) Let the
pywsgi.WSGIServeraccept alogging.Loggerinstance for itslogand (new)error_logparameters. 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.
- Python
Published by jamadden over 10 years ago
gevent - 1.1a2
gevent.threadpool.ThreadPool.imapandimap_unorderednow accept multiple iterables.- (Experimental) Exceptions raised from iterating using the
ThreadPoolorGroupmapping/application functions should now have the original traceback. gevent.threadpool.ThreadPool.applynow raises any exception raised by the called function, the same asgevent.pool.Group/Pooland the builtinapplyfunction. This obsoletes the undocumentedapply_efunction. Original PR #556 by Robert Estelle.- Monkey-patch the
selectorsmodule frompatch_allandpatch_selecton Python 3.4. See #591 . - Additional query functions for the :mod:
gevent.monkeymodule allow knowing what was patched. Discussed in :issue:135and implemented in :pr:325by 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:
597by David Ford. gevent.socket.socket.sendallsupports arbitrary objects that implement the buffer protocol (such as ctypes structures), just like native sockets. Reported in :issue:466by tzickel.- Added support for the
onerrorattribute 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.subprocessmodule is closer in behaviour to the standard library under Python 3, at least on POSIX. Thepass_fds,restore_signals, andstart_new_sessionarguments are now unimplemented, as are thetimeoutparameters to various functions. Under Python 2, the previously undocumentedtimeoutparameter toPopen.communicateraises an exception like its Python 3 counterpart. - An exception starting a child process with the
gevent.subprocessmodule no longer leaks file descriptors. Reported in :pr:374by 陈小玉. - The example
echoserver.pyno longer binds to the standard X11 TCP port. Reported in :issue:485by minusf. gevent.iwaitno longer throwsLoopExitif the caller switches greenlets between return values. Reported and initial patch in :pr:467by Alexey Borzenkov.- The default threadpool and default threaded resolver work in a
forked child process, such as with
multiprocessing.Process. Previously the child process would hang indefinitely. Reported in :issue:230by Lx Yu. - Fork watchers are more likely to (eventually) get called in a multi-threaded program.
gevent.killallaccepts an arbitrary iterable for the greenlets to kill. Reported in :issue:404by Martin Bachwerk; seen in combination with older versions of simple-requests.gevent.local.localobjects 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:387by AusIV.- Killing a greenlet (with
gevent.killorgevent.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:330reported by Jonathan Kamens.
- Python
Published by jamadden over 10 years ago
gevent - 1.1a1
See the changelog for a detailed list of changes.
- Python
Published by jamadden over 10 years ago
gevent - 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.
- Python
Published by jamadden almost 11 years ago
gevent - 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
- Python
Published by denik almost 12 years ago
gevent - gevent 1.0 final
Final version of gevent 1.0.
- Python
Published by denik about 12 years ago