1===========================
2 Changes before gevent 1.0
3===========================
4
5.. currentmodule:: gevent
6
7
8Release 0.13.8 (September 6, 2012)
9==================================
10
11- Fixed :issue:`80`: gevent.httplib failed with RequestFailed errors because timeout was reset to 1s. Patch by Tomasz Prus.
12- core: fix compilation with the latest Cython: remove emit_ifdef/emit_else/emit_endif.
13- Fixed :issue:`132`: gevent.socket.gethostbyname(<unicode>) now does ascii encoding and uses gevent's resolver rather than calling built-in resolver. Patch by Alexey Borzenkov.
14
15
16Release 0.13.7 (April 12, 2012)
17===============================
18
19- Fixed :issue:`94`: fallback to buffer if memoryview fails in _get_memory on python 2.7.
20- Fixed :issue:`103`: ``Queue(None).full()`` returns ``False`` now (previously it returned ``True``).
21- Fixed :issue:`112`: threading._sleep is not patched. Thanks to David LaBissoniere.
22- Fixed :issue:`115`: _dummy gets unexpected Timeout arg.
23
24
25Release 0.13.6 (May 2, 2011)
26============================
27
28- Added ``__copy__`` method to :class:`gevent.local.local` class that implements copy semantics compatible with built-in ``threading.local``. Patch by **Galfy Pundee**.
29- Fixed :class:`StreamServer` class to catch ``EWOULDBLOCK`` rather than ``EAGAIN``. This fixes lots of spurious tracebacks on Windows where these two constants are not the same. Patch by **Alexey Borzenkov**.
30- Fixed :issue:`65`: :func:`fork` now calls ``event_reinit`` only in the child process; otherwise the process could hang when using libevent2. Patch by **Alexander Boudkar**.
31
32
33Release 0.13.5 (Apr 21, 2011)
34=============================
35
36- Fixed build problem on Python 2.5
37
38
39Release 0.13.4 (Apr 11, 2011)
40=============================
41
42- Fixed :exc:`TypeError` that occurred when ``environ["wsgi.input"].read`` function was called with an integer argument.
43- Fixed :issue:`63`: :func:`monkey.patch_thread` now patches :mod:`threading` too, even if it's already imported. Patch by **Shaun Lindsay**.
44- Fixed :issue:`64`: :func:`joinall` and :func:`killall` functions used to hang if their argument contained duplicate greenlets.
45- Fixed :issue:`69`: :class:`pywsgi.WSGIServer` reported "Connection reset by peer" if the client did not close the connection gracefully after the last request. Such errors are now ignored.
46- Fixed :issue:`67`: Made :class:`wsgi.WSGIServer` add ``REQUEST_URI`` to environ. Patch by **Andreas Blixt**.
47- Fixed :issue:`71`: monkey patching ``httplib`` with :mod:`gevent.httplib` used to break ``HTTPSConnection``. Patch by **Nick Barkas**.
48- Fixed :issue:`74`: :func:`create_connection <gevent.socket.create_connection>` now raises proper exception when ``getaddrinfo`` fails.
49- Fixed :meth:`BaseServer.__repr__` method, :attr:`BaseServer.server_host` and :attr:`BaseServer.server_port` attributes to handle the case of ``AF_UNIX`` addresses properly. Previously they assumed address is always a tuple.
50- Fixed :class:`pywsgi.WSGIServer` to handle ``AF_UNIX`` listeners. The server now sets ``environ["SERVER_NAME"]`` and ``environ["SERVER_PORT"]`` to empty string in such case.
51- Make :class:`StreamServer` (and thus :class:`pywsgi.WSGIServer`) accept up to 100 connections per one readiness notification. This behaviour is controlled by :attr:`StreamServer.max_accept` class attribute.
52- If bind fails, the servers now include the address that caused bind to fail in the error message.
53
54
55Release 0.13.3 (Feb 7, 2011)
56============================
57
58- Fixed typo in :mod:`gevent.httplib` that rendered it unusable.
59- Removed unnecessary delay in :func:`getaddrinfo <gevent.socket.getaddrinfo>` by calling ``resolve_ipv4`` and ``resolve_ipv6`` concurrently rather than sequentially in ``AF_UNSPEC`` case.
60
61
62Release 0.13.2 (Jan 28, 2011)
63=============================
64
65- Added :mod:`gevent.httplib` -- **experimental** support for libevent-http client (:issue:`9`). Thanks to **Tommie Gannert**, **Örjan Persson**.
66- Fixed crash on Mac OS X (:issue:`31`). Patch by **Alexey Borzenkov**.
67- Fixed compatiblity of :mod:`gevent.wsgi` with libevent2 (:issue:`62`).
68- Fixed compilation issues with libevent2. Patch by **Ralf Schmitt**.
69- Fixed :mod:`pywsgi` not to use chunked transfer encoding in case of 304 and 204 responses as it creates a non-empty message body which is against RFC and causes some browsers to fail. Patch by **Nicholas Piël**.
70- Fixed :func:`socket.getaddrinfo` to handle ``AF_UNSPEC`` properly and resolve service names (:issue:`56`). Thanks to **Elizabeth Jennifer Myers**.
71- Fixed :func:`socket.getaddrinfo` to handle international domain names.
72- Fixed leaking of traceback object when switching out of greenlet with ``sys.exc_info`` set. Leaking is prevented by not preserving traceback at all and only keeping the value of the exception. Thanks to **Ned Rockson**.
73- Fixed :meth:`ssl.SSLSocket.unwrap` to shutdown :class:`SSLSocket` properly, without raising ``SSLError(read operation timeout)``.
74- Fixed :exc:`TypeError` inside :class:`Hub` on Python 2.4.
75- Made a number of internal improvements to :mod:`gevent.pywsgi` to make subclassing easier.
76- Changed :class:`WSGIServer <pywsgi.WSGIServer>` to explicitly close the socket after the last request. Patch by **Ralf Schmitt**.
77- Fixed :class:`pywsgi.WSGIHandler` not to add ``CONTENT_TYPE`` to the *environ* dict when there's no ``Content-Type`` header in the request. Previously a default ``text/plain`` was added in such case.
78- Added proper implementation of :meth:`imap_unordered <gevent.pool.Group.imap_unordered>` to :class:`Pool` class. Unlike previous "dummy" implementation this one starts yielding the results as soon as they are ready.
79- Implemented iterator protocol in :class:`Queue <gevent.queue.Queue>`. The main use case is the implementation of :meth:`Pool.imap_unordered`.
80- Fixed :attr:`BaseServer.started` property: it is now set to ``True`` after :meth:`start <StreamServer.start>` until :meth:`stop <StreamServer.stop>` or :meth:`kill <StreamServer.kill>`. Previously it could become ``False`` for short period of times, because :class:`StreamServer` could stop accepting for a while in presence of errors and :attr:`StreamServer.started` was defined as "whether the server is currently accepting".
81- Fixed :class:`wsgi.WSGIServer` to reply with 500 error immediately if the application raises an error (:issue:`58`). Thanks to **Jon Aslund**.
82- Added :func:`monkey.patch_httplib` function which is disabled by default.
83- Added *httplib* parameter to :func:`monkey.patch_all` (defaults to ``False``).
84- Added :func:`write <core.buffer.write>` method to :class:`core.buffer`.
85- Fixed :exc:`OverflowError` that could happen in :meth:`core.event.__str__`.
86- Made :meth:`http_request.get_input_headers` return header names in lower case.
87- Fixed :class:`StreamServer` to accept *ciphers* as an SSL argument.
88- Added ``build_exc --cython=`` option to ``setup.py``. Patch by **Ralf Schmitt**.
89- Updated :class:`local <gevent.local.local>` to raise :exc:`AttributeError` if ``__dict__`` attribute is set or deleted.
90
91
92Release 0.13.1 (Sep 23, 2010)
93=============================
94
95Release highlights:
96
97- Fixed :mod:`monkey` to patch :func:`socket.create_connection <gevent.socket.create_connection>`.
98- Updated :mod:`gevent.ssl` module to fully match the functionality of :mod:`ssl` on Python 2.7.
99- Fixed :meth:`Group.join` to handle ``raise_error=True`` properly, it used to raise :exc:`TypeError` (:issue:`36`). Thanks to by **David Hain**.
100- Fixed :mod:`gevent.wsgi` and :mod:`gevent.pywsgi` to join multiple ``Cookie`` headers (:issue:`40`).
101- Fixed :func:`select <gevent.select.select>` to recognize ``long`` arguments in addition to ``int``.
102- Fixed :meth:`Semaphore.acquire` to return ``False`` when timeout expires instead of raising :exc:`AssertionError` (:issue:`39`). Patch by **Erik Näslund**.
103- Fixed :meth:`JoinableQueue.join` to return immediately if queue is already empty (:issue:`45`). Patch by **Dmitry Chechik**.
104- Deprecated :mod:`gevent.sslold` module.
105
106:mod:`gevent.socket` module:
107
108- Overrode :meth:`socket.shutdown` method to interrupt read/write operations on socket.
109- Fixed possible :exc:`NameError` in :meth:`socket.connect_ex` method. Patch by **Alexey Borzenkov**.
110- Fixed socket leak in :func:`create_connection` function.
111- Made :mod:`gevent.socket` import all public items from stdlib :mod:`socket` that do not do I/O.
112
113:mod:`gevent.ssl` module:
114
115- Imported a number of patches from stdlib by **Antoine Pitrou**:
116
117  - Calling :meth:`makefile` method on an SSL object would prevent the underlying socket from being closed until all objects get truly destroyed (Python issue #5238).
118  - SSL handshake would ignore the socket timeout and block indefinitely if the other end didn't respond (Python issue #5103).
119  - When calling :meth:`getpeername` in ``SSLSocket.__init__``, only silence exceptions caused by the "socket not connected" condition.
120
121- Added support for *ciphers* argument.
122- Updated ``SSLSocket.send`` and ``SSLSocket.recv`` methods to match the behavior of stdlib :mod:`ssl` better.
123- Fixed :class:`ssl.SSLObject` to delete events used by other greenlets when closing the instance (:issue:`34`).
124
125Miscellaneous:
126
127- Made :class:`BaseServer` accept ``long`` values as *pool* argument in addition to ``int``.
128- Made :attr:`http._requests` attribute public.
129- Updated webchat example to use file on disk rather than in-memory sqlite database to avoid :exc:`OperationalError`.
130- Fixed ``webproxy.py`` example to be runnable under external WSGI server.
131- Fixed bogus failure in ``test__exc_info.py``.
132- Added new test to check PEP8 conformance: ``xtest_pep8.py``.
133- Fixed :class:`BackdoorServer` close the connection on :exc:`SystemExit` and simplified the code.
134- Made :class:`Pool` raise :exc:`ValueError` when initialized with ``size=0``.
135- Updated ``setup.py --libevent`` to configure and make libevent if it's not built already.
136- Updated ``setup.py`` to use ``setuptools`` if present and add dependency on ``greenlet``.
137- Fixed doc/mysphinxext.py to work with Sphinx 1. Thanks by **Örjan Persson**.
138
139
140Release 0.13.0 (Jul 14, 2010)
141=============================
142
143Release highlights:
144
145- Added :mod:`gevent.server` module with :class:`StreamServer` class for easy implementing of TCP and SSL servers.
146- Added :mod:`gevent.baseserver` module with :class:`BaseServer` class.
147- Added new implementation of :mod:`gevent.pywsgi` based on :mod:`gevent.server`. Contributed by **Ralf Schmitt**.
148- Added :mod:`gevent.local` module. Fixed :issue:`24`. Thanks to **Ted Suzman**.
149- Fixed a number of bugs in :mod:`gevent.wsgi` module.
150- Fixed :issue:`26`: closing a socket now interrupts all pending read/write operations on it.
151- Implemented workaround that prevents greenlets from leaking ``exc_info``.
152- Fixed :meth:`socket.sendall` to use buffer object to prevent string copies.
153- Made the interfaces of :mod:`gevent.wsgi` and :mod:`gevent.pywsgi` much more similar to each other.
154- Fixed compilation on Windows with libevent-2.
155- Improved Windows compatibility. Fixed :issue:`30`. Thanks to **Luigi Pugnetti**.
156- Fixed compatibility with Python 2.7.
157
158Backward-incompatible changes:
159
160- Blocking is now the default behaviour for the :meth:`Greenlet.kill` method and other kill* methods.
161- Changed the inteface of :class:`http.HTTPServer` to match the interface of other servers.
162- Changed :class:`Pool`'s :meth:`spawn` method to block until there's a free slot.
163- Removed deprecated :func:`backdoor.backdoor_server` function.
164- Removed deprecated functions in :mod:`socket` module:
165
166  - :func:`socket_bind_and_listen`
167  - :func:`set_reuse_addr`
168  - :func:`connect_tcp`
169  - :func:`tcp_server`
170
171- Removed deprecated :attr:`socket.fd` property.
172- Deprecated use of negative numbers to indicate infinite timeout in :func:`core.event.add` and :func:`socket.wait_read` and similar. Use ``None`` from now on, which is compatible with the previous versions.
173- Derived :class:`backdoor.BackdoorServer` from :class:`StreamServer` rather than from :class:`Greenlet`. This adds lots of new features and removes a few old ones.
174- Removed non-standard :attr:`balance` property from :class:`Semaphore`.
175- Removed :func:`start`, :func:`set_cb` and :func:`set_gencb` from :class:`core.http`.
176- Removed :func:`set_closecb` from :class:`core.http_connection`. It is now used internally to detach the requests of the closed connections.
177- Deprecated :mod:`rawgreenlet` module.
178- Deprecated :func:`util.lazy_property`.
179- Renamed :class:`GreenletSet` to :class:`Group`. The old name is currently available as an alias.
180
181:mod:`gevent.socket` module:
182
183- Fixed issues :issue:`26` and :issue:`34`: closing the socket while reading/writing/connecting is now safe. Thanks to **Cyril Bay**.
184- Imported :func:`getfqdn` from :mod:`socket` module.
185- The module now uses ``sys.platform`` to detect Windows rather than :mod:`platform` module.
186- Fixed :issue:`27`: :func:`getaddrinfo` used to handle the case when *socktype* or *proto* were equal to ``0``. Thanks to **Randall Leeds**.
187
188:mod:`gevent.coros` module:
189
190- Added :class:`RLock` class.
191- Added :class:`DummySemaphore` class.
192- Fixed :class:`BoundedSemaphore` class to behave like :class:`threading.BoundedSemaphore` behaves.
193
194:mod:`gevent.event` module:
195
196- Made :meth:`Event.wait` return internal flag instead of ``None``.
197- Made :meth:`AsyncResult.wait` return its ``value`` instead of ``None``.
198- Added :meth:`ready` method as an alias for :meth:`is_set`.
199
200:mod:`gevent.wsgi` module:
201
202- Removed :class:`wsgi.buffer_proxy`.
203
204:mod:`gevent.pywsgi` module:
205
206- Rewritten to use :mod:`server` and not to depend on :mod:`BaseHTTPServer`.
207- Changed the interface to match :mod:`wsgi` module.
208  Removed :func:`server` function, add :class:`Server` class, added :class:`WSGIServer` class.
209- Renamed :class:`HttpProtocol` to :class:`WSGIHandler`.
210- Fixed compatibility with webob by allowing an optional argument to :meth:`readline`.
211
212:mod:`gevent.core` module:
213
214- Fixed reference leaks in :class:`event` class.
215- Avoid Python name lookups when accessing EV_* constants from Cython code. Patch by **Daniele Varrazzo**.
216- Added *persist* argument to :class:`read_event`, :class:`write_event` and :class:`readwrite_event`.
217- Made all of the event loop callbacks clear the exception info before exiting.
218- Added :attr:`flags_str` property to :class:`event`. It is used by ``__str__`` and ``__repr__``.
219- :class:`buffer <core.buffer>`:
220
221  - Added :meth:`detach` method.
222  - Implemented iterator protocol.
223  - Fixed :meth:`readline` and :meth:`readlines` methods.
224
225- :class:`http_request`:
226
227  - Fixed :meth:`detach` to detach input and output buffers too.
228  - Changed the response to send 500 error upon deallocation, if no response was sent by the user.
229  - Made :attr:`input_buffer` and :attr:`output_buffer` store and reuse the :class:`buffer` object they create.
230  - Fixed :meth:`__str__` and meth:`__repr__` to include spaces where needed.
231  - :class:`http` class no longer has :meth:`set_cb` and :meth:`set_gencb`. Instead its contructor accepts *handle* which will be called on each request.
232
233:mod:`gevent.http` and :mod:`gevent.wsgi` modules:
234
235- Made :class:`HTTPServer` use ``"Connection: close"`` header by default.
236- Class :class:`HTTPServer` now derives from :class:`baseserver.BaseServer`. Thus its :meth:`start` method no longer accepts socket to listen on, it must be passed to the contructor.
237- The *spawn* argument now accepts a :class:`Pool` instance. While the pool is full, the server replies with 503 error.
238- The server no longer links to the greenlets it spawns to detect errors. Instead, it relies on :class:`http_request` which will send 500 reply when deallocated if the user hasn't send any.
239
240Miscellaneous:
241
242- Changed :mod:`gevent.thread` to use :class:`Greenlet` instead of raw greenlets. This means monkey patched thread will become :class:`Greenlet` too.
243- Added :attr:`started` property to :class:`Greenlet`.
244- Put common server code in :mod:`gevent.baseserver` module. All servers in gevent package are now derived from :class:`BaseServer`.
245- Fixed :issue:`20`: :func:`sleep` now raises :exc:`IOError` if passed a negative argument.
246- Remove the code related to finding out libevent version from setup.py as macro ``USE_LIBEVENT_?`` is no longer needed to build ``gevent.core``.
247- Increased default backlog in all servers (from 5 to 256). Thanks to **Nicholas Piël**.
248- Fixed doc/conf.py to work in Python older than 2.6. Thanks to **Örjan Persson**.
249- Silenced SystemError raised in :mod:`backdoor` when a client typed ``quit()``.
250- If importing :mod:`greenlet` failed with ImportError, keep the original error message,
251  because sometimes the error originates in setuptools.
252- Changed :func:`select.select` to return all the file descriptors signalled, not just the first one.
253- Made :mod:`thread` (and thus monkey patched threads) to spawn :class:`Greenlet` instances, rather than raw greenlets.
254
255Examples:
256
257- Updated echoserver.py to use :class:`StreamServer`.
258- Added geventsendfile.py.
259- Added wsgiserver_ssl.py.
260
261Thanks to **Ralf Schmitt** for :mod:`pywsgi`, a number of fixes for :mod:`wsgi`, help with
262:mod:`baseserver` and :mod:`server` modules, improving setup.py and various other patches and suggestions.
263
264Thanks to **Uriel Katz** for :mod:`pywsgi` patches.
265
266
267Release 0.12.2 (Mar 2, 2010)
268============================
269
270* Fixed http server to put the listening socket into a non-blocking mode. Contributed by **Ralf Schmitt**.
271
272
273Release 0.12.1 (Feb 26, 2010)
274=============================
275
276* Removed a symlink from the distribution (that causes pip to fail). Thanks to **Brad Clements** for reporting it.
277* setup.py: automatically create symlink from ``build/lib.../gevent/core.so`` to ``gevent/core.so``.
278* :mod:`gevent.socket`: Improved compatibility with stdlib's socket:
279
280  - Fixed :class:`socket <gevent.socket.socket>` to raise ``timeout("timed out")`` rather than simply ``timeout``.
281  - Imported ``_GLOBAL_DEFAULT_TIMEOUT`` from standard :mod:`socket` module instead of creating a new object.
282
283
284Release 0.12.0 (Feb 5, 2010)
285============================
286
287Release highlights:
288
289- Added :mod:`gevent.ssl` module.
290- Fixed Windows compatibility (experimental).
291- Improved performance of :meth:`socket.recv`, :meth:`socket.send` and similar methods.
292- Added a new module - :mod:`dns` - with synchronous wrappers around libevent's DNS API.
293- Added :class:`core.readwrite_event` and :func:`socket.wait_readwrite` functions.
294- Fixed several incompatibilities of :mod:`wsgi` module with the WSGI spec.
295- Deprecated :mod:`pywsgi` module.
296
297:mod:`gevent.wsgi` module:
298
299- Made ``env["REMOTE_PORT"]`` into a string.
300- Fixed the server to close the iterator returned by the application.
301- Made ``wsgi.input`` object iterable.
302
303:mod:`gevent.core` module:
304
305- Made DNS functions no longer accept/return IP addresses in dots-and-numbers format. They work
306  with packed IPs now.
307- Made DNS functions no longer accept additional arguments to pass to the callback.
308- Fixed DNS functions to check the return value of the libevent functions and raise
309  :exc:`IOError` if they failed.
310- Added :func:`core.dns_err_to_string`.
311- Made core.event.cancel not to raise if event_del reports an error. instead, the return code is
312  passed to the caller.
313- Fixed minor issue in string representation of the events.
314
315:mod:`gevent.socket` module:
316
317- Fixed bug in socket.accept. It could return unwrapped socket instance if socket's timeout is 0.
318- Fixed socket.sendall implementation never to call underlying socket's sendall.
319- Fixed :func:`gethostbyname` and :func:`getaddrinfo` to call the stdlib if the passed hostname has no dots.
320- Fixed :func:`getaddrinfo` to filter the results using *socktype* and *proto* arguments.
321- Removed :func:`getnameinfo` as it didn't quite match the stdlib interface.
322  Use :func:`dns.resolve_reverse` for reverse resolutions.
323- Fixed :meth:`socket.connect_ex` to use cooperative :func:`gethostbyname`.
324- Fixed :meth:`socket.dup` not to call underlying socket's :meth:`dup` (which is not available
325  on Windows) but to use Python's reference counting similar to how the stdlib's socket
326  implements :meth:`dup`
327- Added *_sock* argument to :class:`socket`'s constructor. Passing the socket instance
328  as first argument is no longer supported.
329- Fixed :func:`socket.connect` to ignore ``WSAEINVAL`` on Windows.
330- Fixed :func:`socket.connect` to use :func:`wait_readwrite` instead of :func:`wait_write`.
331- Fixed :func:`socket.connect` to consult ``SO_ERROR``.
332- Fixed :func:`socket.send` and :func:`socket.sendall` to support *flags* argument.
333- Renamed :func:`socket_bind_and_listen` to :func:`socket.bind_and_listen`. The old name
334  is still available as a deprecated alias.
335- The underlying socket object is now stored as ``_sock`` property.
336- Imported the constants and some utility functions from stdlib's :mod:`socket` into :mod:`gevent.socket`.
337  (Thanks to **Matt Goodall** for the original patch).
338- Renamed :meth:`wrap_ssl` to :meth:`ssl`. (the old name is still available but deprecated)
339- Deprecated :func:`connect_tcp` and :func:`tcp_server`.
340- Added :exc:`sslerror` to ``socket.__all__``.
341- Removed :class:`GreenSocket` alias for socket class.
342- Moved PyOpenSSL-based implementation of :func:`socket.ssl` into :mod:`gevent.oldssl` module.
343  It's imported into :mod:`gevent.socket` if importing :mod:`gevent.ssl` fails.
344
345Miscellaneous:
346
347- Fixed Greenlet.spawn_link* and GreenletSet.spawn_link* classmethods not to assume anything
348  about their arguments. (Thanks to **Marcus Cavanaugh** for pointing that out).
349- Fixed :func:`select <gevent.select.select>` to clean up properly if event creation fails.
350- Fixed :func:`select <gevent.select.select>` to raise :exc:`select.error` instead of :exc:`IOError`.
351- Fixed setup.py to proceed with compilation even if libevent version cannot be determined.
352  1.x.x is assumed in this case.
353- Fixed compatibility of .pyx files with Cython 0.12.0.
354- Renamed arguments for :func:`select.select` to what they are called in the stdlib.
355- Removed internal function :func:`getLinkedCompleted` from :mod:`gevent.greenlet`.
356- Remove ``#warning`` directives from ``libevent.h``. They are not supported by vc90.
357- Removed some deprecated stuff from :mod:`coros`.
358- Internal class :class:`Waiter <gevent.hub.Waiter>` now stores the value if no one's waiting for it.
359- Added ``testrunner.py`` script that replaces a bunch of small scripts that were used before.
360- Removed ``is_secure`` attribute from sockets and ssl objects.
361- Made :class:`Greenlet` not to print a traceback when a not-yet-started greenlet is killed.
362- Added :class:`BackdoorServer` class to :mod:`backdoor`. Removed :func:`backdoor` function and deprecated :func:`backdoor_server` function.
363- Removed ``__getattr__`` from socket class.
364- Fixed :func:`monkey.patch_socket` not to fail if :func:`socket.ssl` is not present in :mod:`gevent.socket`.
365- Added :func:`monkey.patch_ssl`.
366- Added *aggressive* argument to :func:`monkey.patch_all`.
367- Tests from stdlib no longer included in greentest package. Instead, there are number of stubs
368  that import those tests from ``test`` package directly and run them in monkey patched environment.
369- Added examples/process.py by **Marcus Cavanaugh**.
370
371
372Release 0.11.2 (Dec 10, 2009)
373=============================
374
375* Fixed :mod:`wsgi` to unquote ``environ['PATH_INFO']`` before passing to application.
376* Added ``SERVER_SOFTWARE`` variable to :mod:`wsgi` environ.
377* Fixed bug in :meth:`JoinableQueue.task_done` that caused :class:`ValueError` to be raised incorrectly here.
378* Fixed :mod:`gevent.socket` not to fail with :class:`ImportError` if Python was not built with ssl support.
379
380
381Release 0.11.1 (Nov 15, 2009)
382=============================
383
384* Fixed bug in :func:`select.select` function. Passing non-empty list of write descriptors used to cause this function to fail.
385* Changed setup.py to go ahead with the compilation even if the actual version of libevent cannot be determined (version 1.x.x is assumed in that case).
386
387Contributed by **Ludvig Ericson**:
388
389* Fixed :mod:`wsgi`'s ``start_response`` to recognize *exc_info* argument.
390* Fixed setup.py to look for libevent.dylib rather than .so on Darwin platforms.
391
392
393Release 0.11.0 (Oct 9, 2009)
394============================
395
396* Fixed timeout bug in :func:`joinall`, :meth:`Greenlet.join`, :meth:`pool.Pool.join`: if timeout has expired
397  it used to raise :class:`Timeout`; now it returns silently.
398* Fixed :func:`signal` to run the signal handler in a new greenlet; it was run in the :class:`Hub` greenlet before.
399* Fixed :meth:`Timeout.start_new`: if passed a :class:`Timeout` instance, it now calls its :meth:`start <Timeout.start>`
400  method before returning it.
401* Fixed :mod:`gevent.monkey` to patch :class:`threading.local` properly.
402* Fixed :meth:`Queue.empty` and :meth:`Queue.full` to be compatible
403  with the standard :mod:`Queue`. It tried to take into account the greenlets currently blocking on
404  :meth:`get <Queue.get>`/:meth:`put <Queue.put>` which
405  was not useful and hard to reason about. Now it simply compares :meth:`qsize <Queue.qsize>` to *maxsize*,
406  which what the standard :mod:`Queue` does too.
407* Fixed :class:`Event` to behave exactly like the standard :class:`threading.Event`:
408
409  - :meth:`Event.set` does not accept a parameter anymore; it's now either set or not.
410  - ``Event.get`` method is gone.
411  - ``Event.set(); Event.clear()`` used to be a no-op; now it properly wakes up all the waiters.
412  - :class:`AsyncResult` behaves exactly like before, but it does not inherit from :class:`Event` anymore
413    and does miss ``clear()`` method.
414
415* Renamed internal helpers :meth:`socket.wait_reader`/:meth:`socket.wait_writer` to :meth:`socket.wait_read`/:meth:`socket.wait_write`.
416* Renamed :class:`gevent.socket.GreenSocket` to :class:`gevent.socket.socket`. ``GreenSocket`` is still available
417  as an alias but will be removed in the future.
418* :mod:`gevent.core` now includes wrappers for evbuffer, evdns, evhttp.
419* Renamed the old ``gevent.wsgi`` to :mod:`gevent.pywsgi`.
420* Added a new HTTP server :mod:`gevent.http` module based on libevent-http wrappers.
421* Added a new WSGI server :mod:`gevent.wsgi` module based on :mod:`gevent.http`.
422* Added evdns wrappers to :mod:`gevent.core` and DNS functions to :mod:`gevent.socket` module. Contributed by **Jason Toffaletti.**.
423* Added a few a few options to ``setup.py`` to select a libevent library to compile against. Check them out with ``setup.py -h``.
424* Added ``__all__`` to many modules that missed it.
425* Converted the docstrings and the changelog to sphinx/rst markup.
426* Added sphinx/rst documentation. It is available online at http://www.gevent.org.
427
428
429Release 0.10.0 (Aug 26, 2009)
430=============================
431
432* Changed :class:`Timeout` API in a backward-incompatible way:
433  :meth:`Timeout.__init__` does not start the timer immediately anymore;
434  :meth:`Timeout.start` must be called explicitly.
435  A shortcut - :meth:`Timeout.start_new` - is provided that creates and starts
436  a :class:`Timeout`.
437* Added :class:`gevent.Greenlet` class which is a subclass of greenlet that adds a few
438  useful methods :meth:`join <Greenlet.join>`/:meth:`get <Greenlet.get>`/:meth:`kill <Greenlet.kill>`/:meth:`link <Greenlet.link>`.
439* :func:`spawn` now returns :class:`Greenlet` instance. The old ``spawn``, which returns ``py.magic.greenlet``
440  instance, can be still accessed as :meth:`spawn_raw`.
441
442  .. note::
443
444     The implementation of :class:`Greenlet` is an improvement on ``proc`` module, with these bugs fixed:
445
446     * Proc was not a subclass of greenlet which makes :func:`getcurrent` useless and using
447       Procs as keys in dict impossible.
448     * Proc executes links sequentially, so one could block the rest from being
449       executed. :class:`Greenlet` executes each link in a new greenlet by default, unless
450       it is set up with :class:`Greenlet.rawlink` method.
451     * Proc cannot be easily subclassed. To subclass :class:`Greenlet`, override its _run
452       and __init__ methods.
453
454* Added :class:`pool.Pool` class with the methods compatible to the standard :mod:`multiprocessing.pool`:
455  :meth:`apply <Pool.apply>`, :meth:`map <Pool.map>` and others.
456  It also has :meth:`spawn <Pool.spawn>` method which is always async and returns a
457  :class:`Greenlet` instance.
458* Added :mod:`gevent.event` module with 2 classes: :class:`Event` and :class:`AsyncResult`.
459  :class:`Event` is a drop-in replacement for :class:`threading.Event`, supporting
460  :meth:`set <Event.set>`/:meth:`wait <Event.wait>`/``get`` methods. :class:`AsyncResult`
461  is an extension of :class:`Event` that supports exception passing via :meth:`set_exception <AsyncResult.set_exception>` method.
462* Added :class:`queue.JoinableQueue` class with :meth:`task_done <queue.JoinableQueue.task_done>`
463  and :meth:`join <queue.JoinableQueue.join>` methods.
464* Renamed ``core.read`` and ``core.write`` classes to :class:`core.read_event` and :class:`core.write_event`.
465* :mod:`gevent.pywsgi`: pulled **Mike Barton's** eventlet patches that fix double content-length issue.
466* Fixed ``setup.py`` to search more places for system libevent installation.
467  This fixes 64bit CentOS 5.3 installation issues, hopefully covers other platforms
468  as well.
469
470The following items were added to the gevent top level package:
471
472- :func:`spawn_link`
473- :func:`spawn_link_value`
474- :func:`spawn_link_exception`
475- :func:`spawn_raw`
476- :func:`joinall`
477- :func:`killall`
478- :class:`Greenlet`
479- :exc:`GreenletExit`
480- :mod:`core`
481
482The following items were marked as deprecated:
483
484- gevent.proc module (:class:`wrap_errors` helper was moved to :mod:`util` module)
485- gevent.coros.event
486- gevent.coros.Queue and gevent.coros.Channel
487
488Internally, ``gevent.greenlet`` was split into a number of modules:
489
490- :mod:`gevent.hub` provides :class:`Hub` class and basic utilities, like :func:`sleep`;
491  :class:`Hub` is now a subclass of greenlet.
492- :mod:`gevent.timeout` provides :class:`Timeout` and :func:`with_timeout`;
493- :mod:`gevent.greenlet` provides :class:`Greenlet` class and helpers like :func:`joinall` and :func:`killall`.
494- :mod:`gevent.rawgreenlet` contains the old "polling" versions of
495  :func:`joinall <rawgreenlet.joinall>` and :func:`killall <rawgreenlet.killall>` (they do not need :meth:`link <Greenlet.link>`
496  functionality and work with any greenlet by polling their status and sleeping in a loop)
497
498
499Thanks to **Jason Toffaletti** for reporting the installation issue and providing a
500test case for WSGI double content-length header bug.
501
502
503Release 0.9.3 (Aug 3, 2009)
504===========================
505
506* Fixed all known bugs in the :mod:`gevent.queue` module and made it 2.4-compatible.
507  :class:`LifoQueue` and :class:`PriorityQueue` are implemented as well.
508  :mod:`gevent.queue` will deprecate both ``coros.Queue`` and ``coros.Channel``.
509* Fixed :class:`Timeout` to raise itself by default. ``TimeoutError`` is gone.
510  Silent timeout is now created by passing ``False`` instead of ``None``.
511* Fixed bug in :func:`gevent.select.select` where it could silent the wrong timeout.
512* :func:`spawn` and :func:`spawn_later` now avoid creating a closure and this decreases spawning
513  time by 50%.
514* ``kill``'s and ``killall``'s *wait* argument was renamed to *block*. The polling is now
515  implemented by ``greenlet.join`` and ``greenlet.joinall`` functions and it become more
516  responsive, with gradual increase of sleep time.
517* Renamed ``proc.RunningProcSet`` to ``proc.ProcSet``.
518* Added :func:`shutdown` function, which blocks until libevent has finished dispatching the events.
519* The return value of ``event_add`` and ``event_del`` in core.pyx are now checked properly
520  and :exc:`IOError` is raised if they have failed.
521* Fixed backdoor.py, accidentally broken in the previous release.
522
523
524Release 0.9.2 (Jul 20, 2009)
525============================
526
527* Simplified :mod:`gevent.socket`'s implementation and fixed SSL bug reported on eventletdev
528  by **Cesar Alaniz** as well as failures in ``test_socket_ssl.py``.
529* Removed ``GreenSocket.makeGreenFile``; Use :meth:`socket.socket.makefile` that returns :class:`_fileobject`
530  and is available on both :class:`GreenSocket <gevent.socket.socket>` and :class:`GreenSSL <gevent.socket.GreenSSL>`.
531  The :mod:`gevent.socket` is still a work in progress.
532* Added new :class:`core.active_event` class that takes advantage of libevent's ``event_active`` function.
533  ``core.active_event(func)`` schedules func to be run in this event loop iteration as opposed
534  to ``core.timer(0, ...)`` which schedules an event to be run in the next iteration.
535  :class:`active_event` is now used throughout the library wherever ``core.timer(0, ....)`` was previously used.
536  This results in :func:`spawn` being at least 20% faster compared to release 0.9.1 and twice as fast compared to
537  eventlet. (The results are obtained with bench_spawn.py script in ``greentest/`` directory)
538* Added boolean parameter *wait* to :func:`kill` and :func:`killall` functions. If set to ``True``, it makes the
539  function block until the greenlet(s) is actually dead. By default, :func:`kill` and :func:`killall` are asynchronous,
540  i.e. they don't unschedule the current greenlet.
541* Added a few new properties to :class:`gevent.core.event`: :attr:`fd <event.fd>`, :attr:`events <event.events>`,
542  :attr:`events_str <event.events_str>` and :attr:`flags <event.flags>`. It also has :meth:`__enter__ <event.__enter__>`
543  and :meth:`__exit__ <event.__exit__>` now, so it can be used as a context
544  manager. :class:`event`'s :attr:`callback <event.callback>` signature has changed from ``(event, fd, evtype)`` to ``(event, evtype)``.
545* Fixed :class:`Hub`'s mainloop to never return successfully as this will screw up main greenlet's ``switch()`` call.
546  Instead of returning it raises ``DispatchExit``.
547* Added :func:`reinit` function - wrapper for libevent's ``event_reinit``.
548  This function is a must have at least for daemons, as it fixes ``epoll`` and some others eventloops to work after ``fork``.
549* Trying to use gevent in another thread will now raise an exception immediately, since it's not implemented.
550* Added a few more convenience methods ``spawn_link[exception/value]`` to ``proc.RunningProcSet``.
551* Fixed ``setup.py`` not to depend on ``setuptools``.
552* Removed ``gevent.timeout``. Use :class:`gevent.Timeout`.
553
554
555Release 0.9.1 (Jul 9, 2009)
556===========================
557
558* Fixed compilation with libevent-1.3. Thanks to **Litao Wei** for reporting the problem.
559* Fixed :class:`Hub` to recover silently after ``event_dispatch()`` failures (I've seen this
560  happen after ``fork`` even though ``event_reinit()`` is called as necessary). The end result is that :func:`fork`
561  now works more reliably, as detected by ``test_socketserver.py`` - it used to fail occasionally, now it does not.
562* Reorganized the package, most of the stuff from ``gevent/__init__.py`` was moved to ``gevent/greenlet.py``.
563  ``gevent/__init__.py`` imports some of it back but not everything.
564* Renamed ``gevent.timeout`` to :class:`gevent.Timeout`. The old name is available as an alias.
565* Fixed a few bugs in :class:`queue.Queue`.
566  Added test_queue.py from standard tests to check how good is :class:`queue.Queue` a replacement
567  for a standard :mod:`Queue` (not good at all, timeouts in :meth:`queue.Queue.put` don't work yet)
568* :mod:`monkey` now patches ssl module when on 2.6 (very limited support).
569* Improved compatibility with Python 2.6 and Python 2.4.
570* Greenlet installed from PyPI (without py.magic prefix) is properly recognized now.
571* core.pyx was accidentally left out of the source package, it's included now.
572* :class:`GreenSocket <socket.socket>` now wraps a ``socket`` object from ``_socket`` module rather
573  than from :mod:`socket`.
574
575
576Release 0.9.0 (Jul 8, 2009)
577===========================
578
579Started as eventlet_ 0.8.11 fork, with the intention to support only libevent as a backend.
580Compared to eventlet, this version has a much simpler API and implementation and a few
581severe bugs fixed, namely
582
583* Full duplex in sockets, i.e. ``read()`` and ``write()`` on the same fd do not cancel one another.
584* The :meth:`GreenSocket.close <socket.socket.close>` method does not hang as it could with eventlet.
585
586There's a test in my repo of eventlet that reproduces both of them:
587http://bitbucket.org/denis/eventlet/src/tip/greentest/test__socket.py
588
589Besides having less bugs and less code to care about the goals of the fork are:
590
591* Piggy-back on libevent as much as possible (use its http and dns code).
592* Use the interfaces and conventions from the standard Python library where possible.
593
594.. _eventlet: http://bitbucket.org/denis/eventlet
595