Tags: cenllv/tornado
Tags
What's new in Tornado 6.0.3 Jun 22, 2019 ------------ Bug fixes ~~~~~~~~~ - `.gen.with_timeout` always treats ``asyncio.CancelledError`` as a ``quiet_exception`` (this improves compatibility with Python 3.8, which changed ``CancelledError`` to a ``BaseException``). - ``IOStream`` now checks for closed streams earlier, avoiding spurious logged errors in some situations (mainly with websockets).
What's new in Tornado 6.0.2 Mar 23, 2019 ------------ Bug fixes ~~~~~~~~~ - `.WebSocketHandler.set_nodelay` works again. - Accessing ``HTTPResponse.body`` now returns an empty byte string instead of raising ``ValueError`` for error responses that don't have a body (it returned None in this case in Tornado 5).
What's new in Tornado 6.0 Mar 1, 2019 ----------- Backwards-incompatible changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Python 2.7 and 3.4 are no longer supported; the minimum supported Python version is 3.5.2. - APIs deprecated in Tornado 5.1 have been removed. This includes the ``tornado.stack_context`` module and most ``callback`` arguments throughout the package. All removed APIs emitted `DeprecationWarning` when used in Tornado 5.1, so running your application with the ``-Wd`` Python command-line flag or the environment variable ``PYTHONWARNINGS=d`` should tell you whether your application is ready to move to Tornado 6.0. - ``.WebSocketHandler.get`` is now a coroutine and must be called accordingly in any subclasses that override this method (but note that overriding ``get`` is not recommended; either ``prepare`` or ``open`` should be used instead). General changes ~~~~~~~~~~~~~~~ - Tornado now includes type annotations compatible with ``mypy``. These annotations will be used when type-checking your application with ``mypy``, and may be usable in editors and other tools. - Tornado now uses native coroutines internally, improving performance. `tornado.auth` ~~~~~~~~~~~~~~ - All ``callback`` arguments in this package have been removed. Use the coroutine interfaces instead. - The ``OAuthMixin._oauth_get_user`` method has been removed. Override `~.OAuthMixin._oauth_get_user_future` instead. `tornado.concurrent` ~~~~~~~~~~~~~~~~~~~~ - The ``callback`` argument to `.run_on_executor` has been removed. - ``return_future`` has been removed. `tornado.gen` ~~~~~~~~~~~~~ - Some older portions of this module have been removed. This includes ``engine``, ``YieldPoint``, ``Callback``, ``Wait``, ``WaitAll``, ``MultiYieldPoint``, and ``Task``. - Functions decorated with ``@gen.coroutine`` no longer accept ``callback`` arguments. `tornado.httpclient` ~~~~~~~~~~~~~~~~~~~~ - The behavior of ``raise_error=False`` has changed. Now only suppresses the errors raised due to completed responses with non-200 status codes (previously it suppressed all errors). - The ``callback`` argument to `.AsyncHTTPClient.fetch` has been removed. `tornado.httputil` ~~~~~~~~~~~~~~~~~~ - ``HTTPServerRequest.write`` has been removed. Use the methods of ``request.connection`` instead. - Unrecognized ``Content-Encoding`` values now log warnings only for content types that we would otherwise attempt to parse. `tornado.ioloop` ~~~~~~~~~~~~~~~~ - ``IOLoop.set_blocking_signal_threshold``, ``IOLoop.set_blocking_log_threshold``, ``IOLoop.log_stack``, and ``IOLoop.handle_callback_exception`` have been removed. - Improved performance of `.IOLoop.add_callback`. `tornado.iostream` ~~~~~~~~~~~~~~~~~~ - All ``callback`` arguments in this module have been removed except for `.BaseIOStream.set_close_callback`. - ``streaming_callback`` arguments to `.BaseIOStream.read_bytes` and `.BaseIOStream.read_until_close` have been removed. - Eliminated unnecessary logging of "Errno 0". `tornado.log` ~~~~~~~~~~~~~ - Log files opened by this module are now explicitly set to UTF-8 encoding. `tornado.netutil` ~~~~~~~~~~~~~~~~~ - The results of ``getaddrinfo`` are now sorted by address family to avoid partial failures and deadlocks. `tornado.platform.twisted` ~~~~~~~~~~~~~~~~~~~~~~~~~~ - ``TornadoReactor`` and ``TwistedIOLoop`` have been removed. ``tornado.simple_httpclient`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - The default HTTP client now supports the ``network_interface`` request argument to specify the source IP for the connection. - If a server returns a 3xx response code without a ``Location`` header, the response is raised or returned directly instead of trying and failing to follow the redirect. - When following redirects, methods other than ``POST`` will no longer be transformed into ``GET`` requests. 301 (permanent) redirects are now treated the same way as 302 (temporary) and 303 (see other) redirects in this respect. - Following redirects now works with ``body_producer``. ``tornado.stack_context`` ~~~~~~~~~~~~~~~~~~~~~~~~~ - The ``tornado.stack_context`` module has been removed. `tornado.tcpserver` ~~~~~~~~~~~~~~~~~~~ - `.TCPServer.start` now supports a ``max_restarts`` argument (same as `.fork_processes`). `tornado.testing` ~~~~~~~~~~~~~~~~~ - `.AsyncHTTPTestCase` now drops all references to the `.Application` during ``tearDown``, allowing its memory to be reclaimed sooner. - `.AsyncTestCase` now cancels all pending coroutines in ``tearDown``, in an effort to reduce warnings from the python runtime about coroutines that were not awaited. Note that this may cause ``asyncio.CancelledError`` to be logged in other places. Coroutines that expect to be running at test shutdown may need to catch this exception. `tornado.web` ~~~~~~~~~~~~~ - The ``asynchronous`` decorator has been removed. - The ``callback`` argument to `.RequestHandler.flush` has been removed. - `.StaticFileHandler` now supports large negative values for the ``Range`` header and returns an appropriate error for ``end > start``. - It is now possible to set ``expires_days`` in ``xsrf_cookie_kwargs``. `tornado.websocket` ~~~~~~~~~~~~~~~~~~~ - Pings and other messages sent while the connection is closing are now silently dropped instead of logging exceptions. - Errors raised by ``open()`` are now caught correctly when this method is a coroutine. `tornado.wsgi` ~~~~~~~~~~~~~~ - ``WSGIApplication`` and ``WSGIAdapter`` have been removed.
Merge pull request tornadoweb#2588 from bdarnell/6.0b1 Set version to 6.0b1
What's new in Tornado 5.1.1 Sep 16, 2018 ------------ Bug fixes ~~~~~~~~~ - Fixed an case in which the `.Future` returned by `.RequestHandler.finish` could fail to resolve. - The `.TwitterMixin.authenticate_redirect` method works again. - Improved error handling in the `tornado.auth` module, fixing hanging requests when a network or other error occurs.
What's new in Tornado 5.1 July 12, 2018 ------------- Deprecation notice ~~~~~~~~~~~~~~~~~~ - Tornado 6.0 will drop support for Python 2.7 and 3.4. The minimum supported Python version will be 3.5.2. - The `tornado.stack_context` module is deprecated and will be removed in Tornado 6.0. The reason for this is that it is not feasible to provide this module's semantics in the presence of ``async def`` native coroutines. `.ExceptionStackContext` is mainly obsolete thanks to coroutines. `.StackContext` lacks a direct replacement although the new ``contextvars`` package (in the Python standard library beginning in Python 3.7) may be an alternative. - Callback-oriented code often relies on `.ExceptionStackContext` to handle errors and prevent leaked connections. In order to avoid the risk of silently introducing subtle leaks (and to consolidate all of Tornado's interfaces behind the coroutine pattern), ``callback`` arguments throughout the package are deprecated and will be removed in version 6.0. All functions that had a ``callback`` argument removed now return a `.Future` which should be used instead. - Where possible, deprecation warnings are emitted when any of these deprecated interfaces is used. However, Python does not display deprecation warnings by default. To prepare your application for Tornado 6.0, run Python with the ``-Wd`` argument or set the environment variable ``PYTHONWARNINGS`` to ``d``. If your application runs on Python 3 without deprecation warnings, it should be able to move to Tornado 6.0 without disruption. `tornado.auth` ~~~~~~~~~~~~~~ - `.OAuthMixin._oauth_get_user_future` may now be a native coroutine. - All ``callback`` arguments in this package are deprecated and will be removed in 6.0. Use the coroutine interfaces instead. - The ``OAuthMixin._oauth_get_user`` method is deprecated and will be removed in 6.0. Override `~.OAuthMixin._oauth_get_user_future` instead. `tornado.autoreload` ~~~~~~~~~~~~~~~~~~~~ - The command-line autoreload wrapper is now preserved if an internal autoreload fires. - The command-line wrapper no longer starts duplicated processes on windows when combined with internal autoreload. `tornado.concurrent` ~~~~~~~~~~~~~~~~~~~~ - `.run_on_executor` now returns `.Future` objects that are compatible with ``await``. - The ``callback`` argument to `.run_on_executor` is deprecated and will be removed in 6.0. - `.return_future` is deprecated and will be removed in 6.0. `tornado.gen` ~~~~~~~~~~~~~ - Some older portions of this module are deprecated and will be removed in 6.0. This includes `.engine`, `.YieldPoint`, `.Callback`, `.Wait`, `.WaitAll`, `.MultiYieldPoint`, and `.Task`. - Functions decorated with ``@gen.coroutine`` will no longer accept ``callback`` arguments in 6.0. `tornado.httpclient` ~~~~~~~~~~~~~~~~~~~~ - The behavior of ``raise_error=False`` is changing in 6.0. Currently it suppresses all errors; in 6.0 it will only suppress the errors raised due to completed responses with non-200 status codes. - The ``callback`` argument to `.AsyncHTTPClient.fetch` is deprecated and will be removed in 6.0. - `tornado.httpclient.HTTPError` has been renamed to `.HTTPClientError` to avoid ambiguity in code that also has to deal with `tornado.web.HTTPError`. The old name remains as an alias. - ``tornado.curl_httpclient`` now supports non-ASCII characters in username and password arguments. - ``.HTTPResponse.request_time`` now behaves consistently across ``simple_httpclient`` and ``curl_httpclient``, excluding time spent in the ``max_clients`` queue in both cases (previously this time was included in ``simple_httpclient`` but excluded in ``curl_httpclient``). In both cases the time is now computed using a monotonic clock where available. - `.HTTPResponse` now has a ``start_time`` attribute recording a wall-clock (`time.time`) timestamp at which the request started (after leaving the ``max_clients`` queue if applicable). `tornado.httputil` ~~~~~~~~~~~~~~~~~~ - `.parse_multipart_form_data` now recognizes non-ASCII filenames in RFC 2231/5987 (``filename*=``) format. - `.HTTPServerRequest.write` is deprecated and will be removed in 6.0. Use the methods of ``request.connection`` instead. - Malformed HTTP headers are now logged less noisily. `tornado.ioloop` ~~~~~~~~~~~~~~~~ - `.PeriodicCallback` now supports a ``jitter`` argument to randomly vary the timeout. - `.IOLoop.set_blocking_signal_threshold`, `~.IOLoop.set_blocking_log_threshold`, `~.IOLoop.log_stack`, and `.IOLoop.handle_callback_exception` are deprecated and will be removed in 6.0. - Fixed a `KeyError` in `.IOLoop.close` when `.IOLoop` objects are being opened and closed in multiple threads. `tornado.iostream` ~~~~~~~~~~~~~~~~~~ - All ``callback`` arguments in this module are deprecated except for `.BaseIOStream.set_close_callback`. They will be removed in 6.0. - ``streaming_callback`` arguments to `.BaseIOStream.read_bytes` and `.BaseIOStream.read_until_close` are deprecated and will be removed in 6.0. `tornado.netutil` ~~~~~~~~~~~~~~~~~ - Improved compatibility with GNU Hurd. `tornado.options` ~~~~~~~~~~~~~~~~~ - `tornado.options.parse_config_file` now allows setting options to strings (which will be parsed the same way as `tornado.options.parse_command_line`) in addition to the specified type for the option. `tornado.platform.twisted` ~~~~~~~~~~~~~~~~~~~~~~~~~~ - `.TornadoReactor` and `.TwistedIOLoop` are deprecated and will be removed in 6.0. Instead, Tornado will always use the asyncio event loop and twisted can be configured to do so as well. `tornado.stack_context` ~~~~~~~~~~~~~~~~~~~~~~~ - The `tornado.stack_context` module is deprecated and will be removed in 6.0. `tornado.testing` ~~~~~~~~~~~~~~~~~ - `.AsyncHTTPTestCase.fetch` now takes a ``raise_error`` argument. This argument has the same semantics as `.AsyncHTTPClient.fetch`, but defaults to false because tests often need to deal with non-200 responses (and for backwards-compatibility). - The `.AsyncTestCase.stop` and `.AsyncTestCase.wait` methods are deprecated. `tornado.web` ~~~~~~~~~~~~~ - New method `.RequestHandler.detach` can be used from methods that are not decorated with ``@asynchronous`` (the decorator was required to use ``self.request.connection.detach()``. - `.RequestHandler.finish` and `.RequestHandler.render` now return ``Futures`` that can be used to wait for the last part of the response to be sent to the client. - `.FallbackHandler` now calls ``on_finish`` for the benefit of subclasses that may have overridden it. - The `.asynchronous` decorator is deprecated and will be removed in 6.0. - The ``callback`` argument to `.RequestHandler.flush` is deprecated and will be removed in 6.0. `tornado.websocket` ~~~~~~~~~~~~~~~~~~~ - When compression is enabled, memory limits now apply to the post-decompression size of the data, protecting against DoS attacks. - `.websocket_connect` now supports subprotocols. - `.WebSocketHandler` and `.WebSocketClientConnection` now have ``selected_subprotocol`` attributes to see the subprotocol in use. - The `.WebSocketHandler.select_subprotocol` method is now called with an empty list instead of a list containing an empty string if no subprotocols were requested by the client. - `.WebSocketHandler.open` may now be a coroutine. - The ``data`` argument to `.WebSocketHandler.ping` is now optional. - Client-side websocket connections no longer buffer more than one message in memory at a time. - Exception logging now uses `.RequestHandler.log_exception`. `tornado.wsgi` ~~~~~~~~~~~~~~ - `.WSGIApplication` and `.WSGIAdapter` are deprecated and will be removed in Tornado 6.0.
What's new in Tornado 5.0.1 Apr 7, 2018 ----------- Bug fixes ~~~~~~~~~ - Fixed a memory leak when `.IOLoop` objects are created and destroyed. - If `.AsyncTestCase.get_new_ioloop` returns a reference to a preexisting event loop (typically when it has been overridden to return `.IOLoop.current()`), the test's ``tearDown`` method will not close this loop. - Fixed a confusing error message when the synchronous `.HTTPClient` fails to initialize because an event loop is already running. - `.PeriodicCallback` no longer executes twice in a row due to backwards clock adjustments.
PreviousNext