CINXE.COM
Changes for 1.2 - gevent 24.11.2.dev0 documentation
<!doctype html> <html class="no-js" lang="en" data-content_root="./"> <head><meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1"/> <meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Changes for 1.1" href="changelog_1_1.html" /><link rel="prev" title="Changes for 1.3" href="changelog_1_3.html" /> <!-- Generated with Sphinx 8.1.3 and Furo 2024.08.06 --> <title>Changes for 1.2 - gevent 24.11.2.dev0 documentation</title> <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=a3258c64" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=354aac6f" /> <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=302659d7" /> <link rel="stylesheet" type="text/css" href="_static/custom.css?v=e405f49d" /> <style> body { --color-code-background: #eeeedd; --color-code-foreground: black; --color-brand-primary: #7c9a5e; --color-brand-content: #7c9a5e; --color-foreground-border: #b7d897; --font-stack: "SF Pro",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"; --font-stack--monospace: "JetBrainsMono", "JetBrains Mono", "JetBrains Mono Regular", "JetBrainsMono-Regular", ui-monospace, profont, monospace; } @media not print { body[data-theme="dark"] { --color-code-background: #202020; --color-code-foreground: #d0d0d0; } @media (prefers-color-scheme: dark) { body:not([data-theme="light"]) { --color-code-background: #202020; --color-code-foreground: #d0d0d0; } } } </style><script async type="text/javascript" src="/_/static/javascript/readthedocs-addons.js"></script><meta name="readthedocs-project-slug" content="python-gevent" /><meta name="readthedocs-version-slug" content="latest" /><meta name="readthedocs-resolver-filename" content="/changelog_1_2.html" /><meta name="readthedocs-http-status" content="200" /></head> <body> <script> document.body.dataset.theme = localStorage.getItem("theme") || "auto"; </script> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <symbol id="svg-toc" viewBox="0 0 24 24"> <title>Contents</title> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024"> <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"> <title>Menu</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu"> <line x1="3" y1="12" x2="21" y2="12"></line> <line x1="3" y1="6" x2="21" y2="6"></line> <line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"> <title>Expand</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right"> <polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <symbol id="svg-sun" viewBox="0 0 24 24"> <title>Light mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun"> <circle cx="12" cy="12" r="5"></circle> <line x1="12" y1="1" x2="12" y2="3"></line> <line x1="12" y1="21" x2="12" y2="23"></line> <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line> <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line> <line x1="1" y1="12" x2="3" y2="12"></line> <line x1="21" y1="12" x2="23" y2="12"></line> <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line> <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line> </svg> </symbol> <symbol id="svg-moon" viewBox="0 0 24 24"> <title>Dark mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" /> </svg> </symbol> <symbol id="svg-sun-with-moon" viewBox="0 0 24 24"> <title>Auto light/dark, in light mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-custom-derived-from-feather-sun-and-tabler-moon"> <path style="opacity: 50%" d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"/> <line x1="14.5" y1="3.25" x2="14.5" y2="1.25"/> <line x1="14.5" y1="15.85" x2="14.5" y2="17.85"/> <line x1="10.044" y1="5.094" x2="8.63" y2="3.68"/> <line x1="19" y1="14.05" x2="20.414" y2="15.464"/> <line x1="8.2" y1="9.55" x2="6.2" y2="9.55"/> <line x1="20.8" y1="9.55" x2="22.8" y2="9.55"/> <line x1="10.044" y1="14.006" x2="8.63" y2="15.42"/> <line x1="19" y1="5.05" x2="20.414" y2="3.636"/> <circle cx="14.5" cy="9.55" r="3.6"/> </svg> </symbol> <symbol id="svg-moon-with-sun" viewBox="0 0 24 24"> <title>Auto light/dark, in dark mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-custom-derived-from-feather-sun-and-tabler-moon"> <path d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"/> <line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"/> <line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"/> <line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"/> <line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"/> <line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"/> <line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"/> <line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"/> <line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"/> <circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"/> </svg> </symbol> <symbol id="svg-pencil" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-pencil-code"> <path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" /> <path d="M13.5 6.5l4 4" /> <path d="M20 21l2 -2l-2 -2" /> <path d="M17 17l-2 2l2 2" /> </svg> </symbol> <symbol id="svg-eye" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-eye-code"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /> <path d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008" /> <path d="M20 21l2 -2l-2 -2" /> <path d="M17 17l-2 2l2 2" /> </svg> </symbol> </svg> <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation"> <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc"> <label class="overlay sidebar-overlay" for="__navigation"> <div class="visually-hidden">Hide navigation sidebar</div> </label> <label class="overlay toc-overlay" for="__toc"> <div class="visually-hidden">Hide table of contents sidebar</div> </label> <a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a> <div class="page"> <header class="mobile-header"> <div class="header-left"> <label class="nav-overlay-icon" for="__navigation"> <div class="visually-hidden">Toggle site navigation sidebar</div> <i class="icon"><svg><use href="#svg-menu"></use></svg></i> </label> </div> <div class="header-center"> <a href="contents.html"><div class="brand">gevent 24.11.2.dev0 documentation</div></a> </div> <div class="header-right"> <div class="theme-toggle-container theme-toggle-header"> <button class="theme-toggle"> <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div> <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg> <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg> <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg> <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg> </button> </div> <label class="toc-overlay-icon toc-header-icon" for="__toc"> <div class="visually-hidden">Toggle table of contents sidebar</div> <i class="icon"><svg><use href="#svg-toc"></use></svg></i> </label> </div> </header> <aside class="sidebar-drawer"> <div class="sidebar-container"> <div class="sidebar-sticky"><a class="sidebar-brand" href="contents.html"> <div class="sidebar-logo-container"> <img class="sidebar-logo" src="_static/5564530.png" alt="Logo"/> </div> </a><form class="sidebar-search-container" method="get" action="search.html" role="search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input type="hidden" name="check_keywords" value="yes"> <input type="hidden" name="area" value="default"> </form> <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree"> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="install.html">Installation and Requirements</a></li> <li class="toctree-l1 current has-children"><a class="reference internal" href="changelog.html">Changelog</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of Changelog</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="changelog_1_5.html">Changes for 1.5</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_1_4.html">Changes for 1.4</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_1_3.html">Changes for 1.3</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">Changes for 1.2</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_1_1.html">Changes for 1.1</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_1_0.html">Changes for 1.0</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_pre.html">Changes before gevent 1.0</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li> <li class="toctree-l1"><a class="reference internal" href="api/gevent.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent</span></code> – common functions</a></li> <li class="toctree-l1"><a class="reference internal" href="api/gevent.greenlet.html">Greenlet Objects</a></li> <li class="toctree-l1"><a class="reference internal" href="servers.html">Implementing servers</a></li> <li class="toctree-l1 has-children"><a class="reference internal" href="dns.html">Name Resolution (DNS)</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle navigation of Name Resolution (DNS)</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2"><a class="reference internal" href="api/gevent.resolver.thread.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.resolver.thread</span></code> – thread based hostname resolver</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.resolver.ares.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.resolver.ares</span></code> – c-ares based hostname resolver</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.resolver.dnspython.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.resolver.dnspython</span></code> – Pure Python hostname resolver</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.resolver.blocking.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.resolver.blocking</span></code> – Non-cooperative resolver</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="monitoring.html">Monitoring and Debugging gevent Applications</a></li> <li class="toctree-l1"><a class="reference internal" href="loop_impls.html">Event Loop Implementations: libuv and libev</a></li> <li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuring gevent</a></li> </ul> <ul> <li class="toctree-l1 has-children"><a class="reference internal" href="api/index.html">API reference</a><input class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" role="switch" type="checkbox"/><label for="toctree-checkbox-3"><div class="visually-hidden">Toggle navigation of API reference</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2"><a class="reference internal" href="api/gevent.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent</span></code> – common functions</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.timeout.html">Cooperative Timeouts Using <code class="docutils literal notranslate"><span class="pre">gevent.Timeout</span></code></a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.greenlet.html">Greenlet Objects</a></li> <li class="toctree-l2 has-children"><a class="reference internal" href="api/gevent.socket.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.socket</span></code> – Cooperative low-level networking interface</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" role="switch" type="checkbox"/><label for="toctree-checkbox-4"><div class="visually-hidden">Toggle navigation of gevent.socket – Cooperative low-level networking interface</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="api/gevent._socket3.html">Python 3 interface</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.ssl.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.ssl</span></code> – Secure Sockets Layer (SSL/TLS) module</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.select.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.select</span></code> – Waiting for I/O completion</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.selectors.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.selectors</span></code> – High-level IO Multiplexing</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.event.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.event</span></code> – Notifications of multiple listeners</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.queue.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.queue</span></code> – Synchronized queues</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.local.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.local</span></code> – Greenlet-local objects</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.lock.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.lock</span></code> – Locking primitives</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.hub.html"><code class="docutils literal notranslate"><span class="pre">gevent.hub</span></code> - The Event Loop and the Hub</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.core.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.core</span></code> - (deprecated) event loop abstraction</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent</span></code> – common functions</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.backdoor.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.backdoor</span></code> – Interactive greenlet-based network console that can be used in any process</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.baseserver.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.baseserver</span></code> – Base class for implementing servers</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.builtins.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.builtins</span></code> – gevent friendly implementations of builtin functions</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.contextvars.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.contextvars</span></code> – Cooperative <code class="docutils literal notranslate"><span class="pre">contextvars</span></code></a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.core.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.core</span></code> - (deprecated) event loop abstraction</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.event.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.event</span></code> – Notifications of multiple listeners</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.events.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.events</span></code> – Publish/subscribe event infrastructure</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.exceptions.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.exceptions</span></code> – Exceptions</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.fileobject.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.fileobject</span></code> – Wrappers to make file-like objects cooperative</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.hub.html"><code class="docutils literal notranslate"><span class="pre">gevent.hub</span></code> - The Event Loop and the Hub</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.local.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.local</span></code> – Greenlet-local objects</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.lock.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.lock</span></code> – Locking primitives</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.monkey.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.monkey</span></code> – Make the standard library cooperative</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.os.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.os</span></code> – Low-level operating system functions from <code class="xref py py-mod docutils literal notranslate"><span class="pre">os</span></code></a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.pool.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.pool</span></code> – Managing greenlets in a group</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.pywsgi.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.pywsgi</span></code> – A pure-Python, gevent-friendly WSGI server</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.queue.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.queue</span></code> – Synchronized queues</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.resolver.ares.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.resolver.ares</span></code> – c-ares based hostname resolver</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.resolver.blocking.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.resolver.blocking</span></code> – Non-cooperative resolver</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.resolver.dnspython.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.resolver.dnspython</span></code> – Pure Python hostname resolver</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.resolver.thread.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.resolver.thread</span></code> – thread based hostname resolver</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.select.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.select</span></code> – Waiting for I/O completion</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.selectors.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.selectors</span></code> – High-level IO Multiplexing</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.server.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.server</span></code> – TCP/SSL server</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.signal.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.signal</span></code> – Cooperative implementation of special cases of <code class="xref py py-func docutils literal notranslate"><span class="pre">signal.signal()</span></code></a></li> <li class="toctree-l2 has-children"><a class="reference internal" href="api/gevent.socket.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.socket</span></code> – Cooperative low-level networking interface</a><input class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" role="switch" type="checkbox"/><label for="toctree-checkbox-5"><div class="visually-hidden">Toggle navigation of gevent.socket – Cooperative low-level networking interface</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="api/gevent._socket3.html">Python 3 interface</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.ssl.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.ssl</span></code> – Secure Sockets Layer (SSL/TLS) module</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.subprocess.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.subprocess</span></code> – Cooperative <code class="docutils literal notranslate"><span class="pre">subprocess</span></code> module</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.thread.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.thread</span></code> – Implementation of the standard <code class="xref py py-mod docutils literal notranslate"><span class="pre">thread</span></code> module that spawns greenlets</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.threading.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.threading</span></code> – Implementation of the standard <code class="xref py py-mod docutils literal notranslate"><span class="pre">threading</span></code> using greenlets</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.threadpool.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.threadpool</span></code> - A pool of native threads</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.time.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.time</span></code> – Makes <em>sleep</em> gevent aware</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.util.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.util</span></code> – Low-level utilities</a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.ares.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.ares</span></code> – Backwards compatibility alias for <code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.resolver.cares</span></code></a></li> <li class="toctree-l2"><a class="reference internal" href="api/gevent.wsgi.html"><code class="docutils literal notranslate"><span class="pre">gevent.wsgi</span></code> – Historical note only; does not exist</a></li> <li class="toctree-l2 has-children"><a class="reference internal" href="examples/index.html">Examples</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" role="switch" type="checkbox"/><label for="toctree-checkbox-6"><div class="visually-hidden">Toggle navigation of Examples</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="examples/concurrent_download.html">Example concurrent_download.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/dns_mass_resolve.html">Example dns_mass_resolve.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/echoserver.html">Example echoserver.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/geventsendfile.html">Example geventsendfile.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/portforwarder.html">Example portforwarder.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/processes.html">Example processes.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/psycopg2_pool.html">Example psycopg2_pool.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/threadpool.html">Example threadpool.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/udp_client.html">Example udp_client.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/udp_server.html">Example udp_server.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/unixsocket_client.html">Example unixsocket_client.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/unixsocket_server.html">Example unixsocket_server.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/webproxy.html">Example webproxy.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/webpy.html">Example webpy.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/wsgiserver.html">Example wsgiserver.py</a></li> <li class="toctree-l3"><a class="reference internal" href="examples/wsgiserver_ssl.html">Example wsgiserver_ssl.py</a></li> </ul> </li> </ul> </li> </ul> <ul> <li class="toctree-l1 has-children"><a class="reference internal" href="development/index.html">Development</a><input class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" role="switch" type="checkbox"/><label for="toctree-checkbox-7"><div class="visually-hidden">Toggle navigation of Development</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2"><a class="reference internal" href="development/getting_started.html">Getting Started</a></li> <li class="toctree-l2"><a class="reference internal" href="development/installing_from_source.html">Installing From Source</a></li> <li class="toctree-l2"><a class="reference internal" href="development/running_tests.html">Running Tests</a></li> <li class="toctree-l2"><a class="reference internal" href="development/ci.html">Continuous integration</a></li> <li class="toctree-l2"><a class="reference internal" href="development/release_process.html">Release Process</a></li> </ul> </li> </ul> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="success.html">Success stories</a></li> <li class="toctree-l1"><a class="reference internal" href="community.html">Community</a></li> <li class="toctree-l1 current has-children"><a class="reference internal" href="older_releases.html">Information About Older Releases</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" role="switch" type="checkbox"/><label for="toctree-checkbox-8"><div class="visually-hidden">Toggle navigation of Information About Older Releases</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul class="current"> <li class="toctree-l2 has-children"><a class="reference internal" href="whatsnew_1_5.html">What’s new in gevent 1.5</a><input class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" role="switch" type="checkbox"/><label for="toctree-checkbox-9"><div class="visually-hidden">Toggle navigation of What’s new in gevent 1.5</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="changelog_1_5.html">Changes for 1.5</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="whatsnew_1_4.html">What’s new in gevent 1.4</a><input class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" role="switch" type="checkbox"/><label for="toctree-checkbox-10"><div class="visually-hidden">Toggle navigation of What’s new in gevent 1.4</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="changelog_1_4.html">Changes for 1.4</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="whatsnew_1_3.html">What’s new in gevent 1.3</a><input class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" role="switch" type="checkbox"/><label for="toctree-checkbox-11"><div class="visually-hidden">Toggle navigation of What’s new in gevent 1.3</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="changelog_1_3.html">Changes for 1.3</a></li> </ul> </li> <li class="toctree-l2 current has-children"><a class="reference internal" href="whatsnew_1_2.html">What’s new in gevent 1.2</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" role="switch" type="checkbox"/><label for="toctree-checkbox-12"><div class="visually-hidden">Toggle navigation of What’s new in gevent 1.2</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul class="current"> <li class="toctree-l3 current"><a class="current reference internal" href="#">Changes for 1.2</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="whatsnew_1_1.html">What’s new in gevent 1.1</a><input class="toctree-checkbox" id="toctree-checkbox-13" name="toctree-checkbox-13" role="switch" type="checkbox"/><label for="toctree-checkbox-13"><div class="visually-hidden">Toggle navigation of What’s new in gevent 1.1</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="changelog_1_1.html">Changes for 1.1</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="whatsnew_1_0.html">What’s new in gevent 1.0</a><input class="toctree-checkbox" id="toctree-checkbox-14" name="toctree-checkbox-14" role="switch" type="checkbox"/><label for="toctree-checkbox-14"><div class="visually-hidden">Toggle navigation of What’s new in gevent 1.0</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="changelog_1_0.html">Changes for 1.0</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="changelog_1_5.html">Changes for 1.5</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_1_4.html">Changes for 1.4</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_1_3.html">Changes for 1.3</a></li> <li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Changes for 1.2</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_1_1.html">Changes for 1.1</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_1_0.html">Changes for 1.0</a></li> <li class="toctree-l2"><a class="reference internal" href="changelog_pre.html">Changes before gevent 1.0</a></li> </ul> </li> </ul> </div> </div> </div> </div> </aside> <div class="main"> <div class="content"> <div class="article-container"> <a href="#" class="back-to-top muted-link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path> </svg> <span>Back to top</span> </a> <div class="content-icon-container"> <div class="theme-toggle-container theme-toggle-content"> <button class="theme-toggle"> <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div> <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg> <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg> <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg> <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg> </button> </div> <label class="toc-overlay-icon toc-content-icon" for="__toc"> <div class="visually-hidden">Toggle table of contents sidebar</div> <i class="icon"><svg><use href="#svg-toc"></use></svg></i> </label> </div> <article role="main" id="furo-main-content"> <section id="changes-for-1-2"> <h1>Changes for 1.2<a class="headerlink" href="#changes-for-1-2" title="Link to this heading">¶</a></h1> <section id="id1"> <h2>1.2.2 (2017-06-05)<a class="headerlink" href="#id1" title="Link to this heading">¶</a></h2> <ul> <li><p>Testing on Python 3.5 now uses Python 3.5.3 due to SSL changes. See <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/943">issue #943</a>.</p></li> <li><p>Linux CI has been updated from Ubuntu 12.04 to Ubuntu 14.04 since the former has reached EOL.</p></li> <li><p>Linux CI now tests on PyPy2 5.7.1, updated from PyPy2 5.6.0.</p></li> <li><p>Linux CI now tests on PyPy3 3.5-5.7.1-beta, updated from PyPy3 3.3-5.5-alpha.</p></li> <li><p>Python 2 sockets are compatible with the <code class="docutils literal notranslate"><span class="pre">SOCK_CLOEXEC</span></code> flag found on Linux. They no longer pass the socket type or protocol to <code class="docutils literal notranslate"><span class="pre">getaddrinfo</span></code> when <code class="docutils literal notranslate"><span class="pre">connect</span></code> is called. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/944">issue #944</a> by Bernie Hackett.</p></li> <li><p>Replace <code class="docutils literal notranslate"><span class="pre">optparse</span></code> module with <code class="docutils literal notranslate"><span class="pre">argparse</span></code>. See <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/947">issue #947</a>.</p></li> <li><p>Update to version 1.3.1 of <code class="docutils literal notranslate"><span class="pre">tblib</span></code> to fix <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/954">issue #954</a>, reported by ml31415.</p></li> <li><p>Fix the name of the <code class="docutils literal notranslate"><span class="pre">type</span></code> parameter to <code class="xref py py-func docutils literal notranslate"><span class="pre">gevent.socket.getaddrinfo()</span></code> to be correct on Python 3. This would cause callers using keyword arguments to raise a <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#TypeError" title="(in Python v3.13)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code></a>. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/960">issue #960</a> by js6626069. Likewise, correct the argument names for <code class="docutils literal notranslate"><span class="pre">fromfd</span></code> and <code class="docutils literal notranslate"><span class="pre">socketpair</span></code> on Python 2, although they cannot be called with keyword arguments under CPython.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>The <code class="docutils literal notranslate"><span class="pre">gethost*</span></code> 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.</p> </div> </li> <li><p>The previously-singleton exception objects <code class="docutils literal notranslate"><span class="pre">FileObjectClosed</span></code> and <code class="docutils literal notranslate"><span class="pre">cancel_wait_ex</span></code> 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.</p></li> <li><p>Make sure that <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">gevent.monkey</span> <span class="pre"><script></span></code> runs code in the global scope, not the scope of the <code class="docutils literal notranslate"><span class="pre">main</span></code> function. Fixed in <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/975">pull request #975</a> by Shawn Bohrer.</p></li> </ul> </section> <section id="id2"> <h2>1.2.1 (2017-01-12)<a class="headerlink" href="#id2" title="Link to this heading">¶</a></h2> <ul class="simple"> <li><p>CI services now test on 3.6.0.</p></li> <li><p>Windows: Provide <code class="docutils literal notranslate"><span class="pre">socket.socketpair</span></code> 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.</p></li> <li><p>Windows: List <code class="docutils literal notranslate"><span class="pre">subprocess.STARTUPINFO</span></code> in <code class="docutils literal notranslate"><span class="pre">subprocess.__all__</span></code> for 3.6 compatibility.</p></li> <li><p>The <code class="docutils literal notranslate"><span class="pre">_DummyThread</span></code> objects created by calling <a class="reference external" href="https://docs.python.org/3/library/threading.html#threading.current_thread" title="(in Python v3.13)"><code class="xref py py-func docutils literal notranslate"><span class="pre">threading.current_thread()</span></code></a> from inside a raw <a class="reference internal" href="api/gevent.greenlet.html#gevent.greenlet.greenlet" title="gevent.greenlet.greenlet"><code class="xref py py-class docutils literal notranslate"><span class="pre">greenlet.greenlet</span></code></a> in a system with monkey-patched <code class="docutils literal notranslate"><span class="pre">threading</span></code> now clean up after themselves when the greenlet dies (<a class="reference internal" href="api/gevent.greenlet.html#gevent.Greenlet" title="gevent.Greenlet"><code class="xref py py-class docutils literal notranslate"><span class="pre">gevent.Greenlet</span></code></a>-based <code class="docutils literal notranslate"><span class="pre">_DummyThreads</span></code> have always cleaned up). This requires the use of a <a class="reference external" href="https://docs.python.org/3/library/weakref.html#weakref.ref" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">weakref.ref</span></code></a> (and may not be timely on PyPy). Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/918">issue #918</a> by frozenoctobeer.</p></li> <li><p>Build OS X wheels with <code class="docutils literal notranslate"><span class="pre">-D_DARWIN_FEATURE_CLOCK_GETTIME=0</span></code> for compatibility with OS X releases before 10.12 Sierra. Reported by Ned Batchelder in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/916">issue #916</a>.</p></li> </ul> </section> <section id="id3"> <h2>1.2.0 (2016-12-23)<a class="headerlink" href="#id3" title="Link to this heading">¶</a></h2> <ul class="simple"> <li><p>The c-ares DNS resolver ignores bad flags to getnameinfo, like the system resolver does. Discovered when cleaning up the DNS resolver tests to produce more reliable results. See <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/774">issue #774</a>.</p></li> </ul> </section> <section id="a2-dec-9-2016"> <h2>1.2a2 (Dec 9, 2016)<a class="headerlink" href="#a2-dec-9-2016" title="Link to this heading">¶</a></h2> <ul class="simple"> <li><p>Update libev to version 4.23.</p></li> <li><p>Allow the <code class="docutils literal notranslate"><span class="pre">MAKE</span></code> environment variable to specify the make command on non-Windows systems for ease of development on BSD systems where <code class="docutils literal notranslate"><span class="pre">make</span></code> is BSD make and <code class="docutils literal notranslate"><span class="pre">gmake</span></code> is GNU make (gevent requires GNU make). See <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/888">issue #888</a>.</p></li> <li><p>Let <a class="reference internal" href="api/gevent.server.html#gevent.server.StreamServer" title="gevent.server.StreamServer"><code class="xref py py-class docutils literal notranslate"><span class="pre">gevent.server.StreamServer</span></code></a> accept an <code class="docutils literal notranslate"><span class="pre">SSLContext</span></code> on Python versions that support it. Added in <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/904">pull request #904</a> by Arcadiy Ivanov.</p></li> </ul> </section> <section id="a1-oct-27-2016"> <h2>1.2a1 (Oct 27, 2016)<a class="headerlink" href="#a1-oct-27-2016" title="Link to this heading">¶</a></h2> <section id="incompatible-changes"> <h3>Incompatible Changes<a class="headerlink" href="#incompatible-changes" title="Link to this heading">¶</a></h3> <ul class="simple"> <li><p>Support for Python 2.6 has been removed. See <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/766">pull request #766</a>.</p></li> <li><p>Remove module <code class="docutils literal notranslate"><span class="pre">gevent.coros</span></code> which was replaced by <code class="docutils literal notranslate"><span class="pre">gevent.lock</span></code> and has been deprecated since 1.0b2.</p></li> <li><p>The internal implementation modules <code class="docutils literal notranslate"><span class="pre">gevent.corecext</span></code> and <code class="docutils literal notranslate"><span class="pre">gevent.corecffi</span></code> have been moved. Please import from <code class="docutils literal notranslate"><span class="pre">gevent.core</span></code> instead; this has always been the only documented place to import from.</p></li> </ul> </section> <section id="libraries-and-installation"> <h3>Libraries and Installation<a class="headerlink" href="#libraries-and-installation" title="Link to this heading">¶</a></h3> <ul class="simple"> <li><p>Update libev to version 4.22 (was 4.20).</p></li> <li><p>Update tblib to 1.3.0.</p></li> <li><p>Update Cython to 0.25 (was 0.23.5).</p></li> <li><p>Update c-ares to version 1.12.0 (was 1.10.0) (<a class="reference external" href="https://c-ares.haxx.se/changelog.html">release notes</a>).</p></li> <li><p>For the benefit of downstream package maintainers, gevent is now tested with c-ares and libev linked dynamically and not embedded (i.e., using the system libraries). However, only the versions shipped with gevent are tested and known to work.</p></li> <li><p>The repository directory layout has been changed to make it easier to include third-party dependencies. Likewise, the setup.py script has been split to make it easier to build third-party dependencies.</p></li> <li><p>PyPy/CFFI: The corecffi native extension is now only built at installation time. Previously, if it wasn’t available, a build was attempted at every import. This could lead to scattered “gevent” directories and undependable results.</p></li> <li><p>setuptools is now required at build time on all platforms. Previously it was only required for Windows and PyPy.</p></li> <li><p>POSIX: Don’t hardcode <code class="docutils literal notranslate"><span class="pre">/bin/sh</span></code> into the configuration command line, instead relying on <code class="docutils literal notranslate"><span class="pre">sh</span></code> being on the <code class="docutils literal notranslate"><span class="pre">PATH</span></code>, as recommended by <a class="reference external" href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html">the standard</a>. Fixed in <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/809">pull request #809</a> by Fredrix Fornwall.</p></li> </ul> </section> <section id="security"> <h3>Security<a class="headerlink" href="#security" title="Link to this heading">¶</a></h3> <ul class="simple"> <li><p><a class="reference internal" href="api/gevent.pywsgi.html#module-gevent.pywsgi" title="gevent.pywsgi"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.pywsgi</span></code></a> now checks that the values passed to <code class="docutils literal notranslate"><span class="pre">start_response</span></code> do not contain a carriage return or newline in order to prevent HTTP response splitting (header injection), raising a <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#ValueError" title="(in Python v3.13)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code></a> if they do. See <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/775">issue #775</a>.</p></li> <li><p>Incoming headers containing an underscore are no longer placed in the WSGI environ. See <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/819">issue #819</a>.</p></li> <li><p>Errors logged by <a class="reference internal" href="api/gevent.pywsgi.html#gevent.pywsgi.WSGIHandler" title="gevent.pywsgi.WSGIHandler"><code class="xref py py-class docutils literal notranslate"><span class="pre">WSGIHandler</span></code></a> 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 <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/779">pull request #779</a> by sean-peters-au and changed in <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/781">pull request #781</a>.</p></li> </ul> </section> <section id="platforms"> <h3>Platforms<a class="headerlink" href="#platforms" title="Link to this heading">¶</a></h3> <ul class="simple"> <li><p>As mentioned above, Python 2.6 is no longer supported.</p></li> <li><p>Python 3.6 is now tested on POSIX platforms. This includes a few notable changes:</p> <ul> <li><p>SSLContext.wrap_socket accepts the <code class="docutils literal notranslate"><span class="pre">session</span></code> parameter, though this parameter isn’t useful prior to 3.6.</p></li> <li><p>SSLSocket.recv(0) or read(0) returns an empty byte string. This is a fix for <a class="reference external" href="http://bugs.python.org/issue23804">Python bug #23804</a> which has also been merged into Python 2.7 and Python 3.5.</p></li> </ul> </li> <li><p>PyPy3 5.5.0 <em>alpha</em> (supporting Python 3.3.5) is now tested and passes the test suite. Thanks to btegs for <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/866">issue #866</a>, and Fabio Utzig for <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/826">pull request #826</a>. Note that PyPy3 is not optimized for performance either by the PyPy developers or under gevent, so it may be significantly slower than PyPy2.</p></li> </ul> </section> <section id="stdlib-compatibility"> <h3>Stdlib Compatibility<a class="headerlink" href="#stdlib-compatibility" title="Link to this heading">¶</a></h3> <ul class="simple"> <li><p>The modules <a class="reference internal" href="api/gevent.os.html#module-gevent.os" title="gevent.os"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.os</span></code></a>, <a class="reference internal" href="api/gevent.signal.html#module-gevent.signal" title="gevent.signal"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.signal</span></code></a> and <a class="reference internal" href="api/gevent.select.html#module-gevent.select" title="gevent.select"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.select</span></code></a> export all the attributes from their corresponding standard library counterpart.</p></li> <li><p>Python 2: <code class="docutils literal notranslate"><span class="pre">reload(site)</span></code> no longer fails with a <code class="docutils literal notranslate"><span class="pre">TypeError</span></code> if gevent has been imported. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/805">issue #805</a> by Jake Hilton.</p></li> <li><p>Python 2: <code class="docutils literal notranslate"><span class="pre">sendall</span></code> on a non-blocking socket could spuriously fail with a timeout.</p></li> </ul> <section id="select-poll"> <h4>select/poll<a class="headerlink" href="#select-poll" title="Link to this heading">¶</a></h4> <ul class="simple"> <li><p>If <a class="reference internal" href="api/gevent.select.html#gevent.select.select" title="gevent.select.select"><code class="xref py py-func docutils literal notranslate"><span class="pre">gevent.select.select()</span></code></a> is given a negative <em>timeout</em> argument, raise an exception like the standard library does.</p></li> <li><p>If <a class="reference internal" href="api/gevent.select.html#gevent.select.select" title="gevent.select.select"><code class="xref py py-func docutils literal notranslate"><span class="pre">gevent.select.select()</span></code></a> is given closed or invalid file descriptors in any of its lists, raise the appropriate <code class="docutils literal notranslate"><span class="pre">EBADF</span></code> 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.</p></li> <li><p><a class="reference external" href="https://docs.python.org/3/library/selectors.html#selectors.SelectSelector" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">selectors.SelectSelector</span></code></a> is properly monkey-patched regardless of the order of imports. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/835">issue #835</a> by Przemysław Węgrzyn.</p></li> <li><p><a class="reference internal" href="api/gevent.select.html#gevent.select.poll.unregister" title="gevent.select.poll.unregister"><code class="xref py py-meth docutils literal notranslate"><span class="pre">gevent.select.poll.unregister()</span></code></a> raises an exception if <em>fd</em> is not registered, like the standard library.</p></li> <li><p><a class="reference internal" href="api/gevent.select.html#gevent.select.poll.poll" title="gevent.select.poll.poll"><code class="xref py py-meth docutils literal notranslate"><span class="pre">gevent.select.poll.poll()</span></code></a> returns an event with <code class="docutils literal notranslate"><span class="pre">POLLNVAL</span></code> for registered fds that are invalid. Previously it would tend to report both read and write events.</p></li> </ul> </section> <section id="file-objects"> <h4>File objects<a class="headerlink" href="#file-objects" title="Link to this heading">¶</a></h4> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">FileObjectPosix</span></code> exposes the <code class="docutils literal notranslate"><span class="pre">read1</span></code> method when in read mode, and generally only exposes methods appropriate to the mode it is in.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">FileObjectPosix</span></code> supports a <em>bufsize</em> of 0 in binary write modes. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/840">issue #840</a> by Mike Lang.</p></li> <li><p>Python 3: <code class="xref py py-meth docutils literal notranslate"><span class="pre">gevent.socket.connect_ex()</span></code> was letting <code class="docutils literal notranslate"><span class="pre">BlockingIOError</span></code> (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 <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/841">issue #841</a> by Dana Powers.</p></li> </ul> </section> </section> <section id="other-changes"> <h3>Other Changes<a class="headerlink" href="#other-changes" title="Link to this heading">¶</a></h3> <ul class="simple"> <li><p><a class="reference internal" href="api/gevent.pool.html#gevent.pool.Group" title="gevent.pool.Group"><code class="xref py py-class docutils literal notranslate"><span class="pre">Group</span></code></a> and <a class="reference internal" href="api/gevent.pool.html#gevent.pool.Pool" title="gevent.pool.Pool"><code class="xref py py-class docutils literal notranslate"><span class="pre">Pool</span></code></a> now return whether <a class="reference internal" href="api/gevent.pool.html#gevent.pool.Group.join" title="gevent.pool.Group.join"><code class="xref py py-meth docutils literal notranslate"><span class="pre">join()</span></code></a> returned with an empty group. Suggested by Filippo Sironi in <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/503">pull request #503</a>.</p></li> <li><p>Unhandled exception reports that kill a greenlet now include a timestamp. See <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/137">issue #137</a>.</p></li> <li><p><a class="reference internal" href="api/gevent.queue.html#gevent.queue.PriorityQueue" title="gevent.queue.PriorityQueue"><code class="xref py py-class docutils literal notranslate"><span class="pre">PriorityQueue</span></code></a> now ensures that an initial items list is a valid heap. Fixed in <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/793">pull request #793</a> by X.C.Dong.</p></li> <li><p><code class="xref py py-class docutils literal notranslate"><span class="pre">gevent.hub.signal</span></code> (aka <a class="reference internal" href="api/gevent.signal.html#module-gevent.signal" title="gevent.signal"><code class="xref py py-func docutils literal notranslate"><span class="pre">gevent.signal()</span></code></a>) now verifies that its <code class="xref py py-obj docutils literal notranslate"><span class="pre">handler</span></code> argument is callable, raising a <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#TypeError" title="(in Python v3.13)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code></a> if it isn’t. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/818">issue #818</a> by Peter Renström.</p></li> <li><p>If <code class="docutils literal notranslate"><span class="pre">sys.stderr</span></code> has been monkey-patched (not recommended), exceptions that the hub reports aren’t lost and can still be caught. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/825">issue #825</a> by Jelle Smet.</p></li> <li><p>The <a class="reference internal" href="api/gevent.os.html#gevent.os.waitpid" title="gevent.os.waitpid"><code class="xref py py-func docutils literal notranslate"><span class="pre">gevent.os.waitpid()</span></code></a> function is cooperative in more circumstances. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/878">issue #878</a> by Heungsub Lee.</p></li> <li><p>The various <code class="docutils literal notranslate"><span class="pre">FileObject</span></code> implementations are more consistent with each other. <strong>Note:</strong> Writing to the <em>io</em> property of a FileObject should be considered deprecated.</p></li> <li><p>Timeout exceptions (and other asynchronous exceptions) could cause the BackdoorServer to fail to properly manage the stdout/stderr/stdin values. Reported with a patch in <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/874">pull request #874</a> by stefanmh.</p></li> <li><p>The BackDoorServer now tracks spawned greenlets (connections) and kills them in its <code class="docutils literal notranslate"><span class="pre">stop</span></code> method.</p></li> </ul> <section id="servers"> <h4>Servers<a class="headerlink" href="#servers" title="Link to this heading">¶</a></h4> <ul class="simple"> <li><p>Default to AF_INET6 when binding to all addresses (e.g., “”). This supports both IPv4 and IPv6 connections (except on Windows). Original change in <a class="extlink-pr reference external" href="https://github.com/gevent/gevent/pull/495">pull request #495</a> by Felix Kaiser.</p></li> <li><p>pywsgi/performance: Chunks of data the application returns are no longer copied before being sent to the socket when the transfer-encoding is chunked, potentially reducing overhead for large responses.</p></li> </ul> </section> <section id="threads"> <h4>Threads<a class="headerlink" href="#threads" title="Link to this heading">¶</a></h4> <ul class="simple"> <li><p>Add <a class="reference internal" href="api/gevent.threadpool.html#gevent.threadpool.ThreadPoolExecutor" title="gevent.threadpool.ThreadPoolExecutor"><code class="xref py py-class docutils literal notranslate"><span class="pre">gevent.threadpool.ThreadPoolExecutor</span></code></a> (a <a class="reference external" href="https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">concurrent.futures.ThreadPoolExecutor</span></code></a> variant that always uses native threads even when the system has been monkey-patched) on platforms that have <code class="docutils literal notranslate"><span class="pre">concurrent.futures</span></code> available (Python 3 and Python 2 with the <code class="docutils literal notranslate"><span class="pre">futures</span></code> backport installed). This is helpful for, e.g., grpc. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/786">issue #786</a> by Markus Padourek.</p></li> <li><p>Native threads created before monkey-patching threading can now be joined. Previously on Python < 3.4, doing so would raise a <code class="docutils literal notranslate"><span class="pre">LoopExit</span></code> error. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/747">issue #747</a> by Sergey Vasilyev.</p></li> </ul> </section> <section id="ssl"> <h4>SSL<a class="headerlink" href="#ssl" title="Link to this heading">¶</a></h4> <ul class="simple"> <li><p>On Python 2.7.9 and above (more generally, when the SSL backport is present in Python 2), <a class="reference internal" href="api/gevent.ssl.html#gevent.ssl.get_server_certificate" title="gevent.ssl.get_server_certificate"><code class="xref py py-func docutils literal notranslate"><span class="pre">gevent.ssl.get_server_certificate()</span></code></a> would raise a <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#ValueError" title="(in Python v3.13)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code></a> if the system wasn’t monkey-patched. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/801">issue #801</a> by Gleb Dubovik.</p></li> <li><p>On Python 2.7.9 and Python 3, closing an SSL socket in one greenlet while it’s being read from or written to in a different greenlet is less likely to raise a <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#TypeError" title="(in Python v3.13)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code></a> instead of a <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#ValueError" title="(in Python v3.13)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code></a>. Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/800">issue #800</a> by Kevin Chen.</p></li> </ul> </section> <section id="subprocess-module"> <h4>subprocess module<a class="headerlink" href="#subprocess-module" title="Link to this heading">¶</a></h4> <ul class="simple"> <li><p>Setting SIGCHLD to SIG_IGN or SIG_DFL after <a class="reference internal" href="api/gevent.subprocess.html#module-gevent.subprocess" title="gevent.subprocess"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.subprocess</span></code></a> had been used previously could not be reversed, causing <code class="docutils literal notranslate"><span class="pre">Popen.wait</span></code> and other calls to hang. Now, if SIGCHLD has been ignored, the next time <a class="reference internal" href="api/gevent.subprocess.html#module-gevent.subprocess" title="gevent.subprocess"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.subprocess</span></code></a> is used this will be detected and corrected automatically. (This potentially leads to issues with <a class="reference external" href="https://docs.python.org/3/library/os.html#os.popen" title="(in Python v3.13)"><code class="xref py py-func docutils literal notranslate"><span class="pre">os.popen()</span></code></a> 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 <a class="reference internal" href="api/gevent.subprocess.html#module-gevent.subprocess" title="gevent.subprocess"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.subprocess</span></code></a> is tricky.) Reported in <a class="extlink-issue reference external" href="https://github.com/gevent/gevent/issues/857">issue #857</a> by Chris Utz.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">Popen.kill</span></code> and <code class="docutils literal notranslate"><span class="pre">send_signal</span></code> no longer attempt to send signals to processes that are known to be exited.</p></li> </ul> <p>Several backwards compatible updates to the subprocess module have been backported from Python 3 to Python 2, making <a class="reference internal" href="api/gevent.subprocess.html#module-gevent.subprocess" title="gevent.subprocess"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.subprocess</span></code></a> smaller, easier to maintain and in some cases safer.</p> <ul class="simple"> <li><p>Popen objects can be used as context managers even on Python 2. The high-level API functions (<code class="docutils literal notranslate"><span class="pre">call</span></code>, etc) use this for added safety.</p></li> <li><p>The <a class="reference internal" href="api/gevent.subprocess.html#module-gevent.subprocess" title="gevent.subprocess"><code class="xref py py-mod docutils literal notranslate"><span class="pre">gevent.subprocess</span></code></a> module now provides the <a class="reference internal" href="api/gevent.subprocess.html#gevent.subprocess.run" title="gevent.subprocess.run"><code class="xref py py-func docutils literal notranslate"><span class="pre">gevent.subprocess.run()</span></code></a> 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.)</p></li> <li><p>Popen objects save their <em>args</em> attribute even on Python 2.</p></li> <li><p><a class="reference internal" href="api/gevent.subprocess.html#gevent.subprocess.TimeoutExpired" title="gevent.subprocess.TimeoutExpired"><code class="xref py py-exc docutils literal notranslate"><span class="pre">gevent.subprocess.TimeoutExpired</span></code></a> is defined even on Python 2, where it is a subclass of the <a class="reference internal" href="api/gevent.timeout.html#gevent.Timeout" title="gevent.timeout.Timeout"><code class="xref py py-exc docutils literal notranslate"><span class="pre">gevent.timeout.Timeout</span></code></a> exception; all instances where a <code class="docutils literal notranslate"><span class="pre">Timeout</span></code> exception would previously be thrown under Python 2 will now throw a <code class="docutils literal notranslate"><span class="pre">TimeoutExpired</span></code> exception.</p></li> <li><p><a class="reference internal" href="api/gevent.subprocess.html#gevent.subprocess.call" title="gevent.subprocess.call"><code class="xref py py-func docutils literal notranslate"><span class="pre">gevent.subprocess.call()</span></code></a> (and <code class="docutils literal notranslate"><span class="pre">check_call</span></code>) accepts the <em>timeout</em> keyword argument on Python 2. This is standard on Python 3, but a gevent extension on Python 2.</p></li> <li><p><a class="reference internal" href="api/gevent.subprocess.html#gevent.subprocess.check_output" title="gevent.subprocess.check_output"><code class="xref py py-func docutils literal notranslate"><span class="pre">gevent.subprocess.check_output()</span></code></a> accepts the <em>timeout</em> and <em>input</em> arguments on Python 2. This is standard on Python 3, but a gevent extension on Python 2.</p></li> </ul> </section> </section> </section> </section> </article> </div> <footer> <div class="related-pages"> <a class="next-page" href="changelog_1_1.html"> <div class="page-info"> <div class="context"> <span>Next</span> </div> <div class="title">Changes for 1.1</div> </div> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> </a> <a class="prev-page" href="changelog_1_3.html"> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> <div class="page-info"> <div class="context"> <span>Previous</span> </div> <div class="title">Changes for 1.3</div> </div> </a> </div> <div class="bottom-of-page"> <div class="left-details"> <div class="copyright"> Copyright © 2009-2023, gevent contributors </div> Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s <a href="https://github.com/pradyunsg/furo">Furo</a> </div> <div class="right-details"> </div> </div> </footer> </div> <aside class="toc-drawer"> <div class="toc-sticky toc-scroll"> <div class="toc-title-container"> <span class="toc-title"> On this page </span> </div> <div class="toc-tree-container"> <div class="toc-tree"> <ul> <li><a class="reference internal" href="#">Changes for 1.2</a><ul> <li><a class="reference internal" href="#id1">1.2.2 (2017-06-05)</a></li> <li><a class="reference internal" href="#id2">1.2.1 (2017-01-12)</a></li> <li><a class="reference internal" href="#id3">1.2.0 (2016-12-23)</a></li> <li><a class="reference internal" href="#a2-dec-9-2016">1.2a2 (Dec 9, 2016)</a></li> <li><a class="reference internal" href="#a1-oct-27-2016">1.2a1 (Oct 27, 2016)</a><ul> <li><a class="reference internal" href="#incompatible-changes">Incompatible Changes</a></li> <li><a class="reference internal" href="#libraries-and-installation">Libraries and Installation</a></li> <li><a class="reference internal" href="#security">Security</a></li> <li><a class="reference internal" href="#platforms">Platforms</a></li> <li><a class="reference internal" href="#stdlib-compatibility">Stdlib Compatibility</a><ul> <li><a class="reference internal" href="#select-poll">select/poll</a></li> <li><a class="reference internal" href="#file-objects">File objects</a></li> </ul> </li> <li><a class="reference internal" href="#other-changes">Other Changes</a><ul> <li><a class="reference internal" href="#servers">Servers</a></li> <li><a class="reference internal" href="#threads">Threads</a></li> <li><a class="reference internal" href="#ssl">SSL</a></li> <li><a class="reference internal" href="#subprocess-module">subprocess module</a></li> </ul> </li> </ul> </li> </ul> </li> </ul> </div> </div> </div> </aside> </div> </div><script src="_static/documentation_options.js?v=32fdf4fc"></script> <script src="_static/doctools.js?v=9bcbadda"></script> <script src="_static/sphinx_highlight.js?v=dc90522c"></script> <script src="_static/scripts/furo.js?v=5fa4622c"></script> </body> </html>