Tags: mgorny/tornado
Tags
What's new in Tornado 6.2.0
Jul 3, 2022
-----------
Deprecation notice
~~~~~~~~~~~~~~~~~~
- Python 3.10 has begun the process of significant changes to the APIs for
managing the event loop. Calls to methods such as `asyncio.get_event_loop` may
now raise `DeprecationWarning` if no event loop is running. This has
significant impact on the patterns for initializing applications, and in
particular invalidates patterns that have long been the norm in Tornado's
documentation and actual usage. In the future (with some as-yet-unspecified
future version of Python), the old APIs will be removed. The new recommended
pattern is to start the event loop with `asyncio.run`. More detailed migration
guides will be coming in the future.
- The `.IOLoop` constructor is deprecated unless the ``make_current=False``
argument is used. Use `.IOLoop.current` when the loop is already running
instead.
- `.AsyncTestCase` (and `.AsyncHTTPTestCase`) are deprecated. Use
`unittest.IsolatedAsyncioTestCase` instead.
- Multi-process `.TCPServer.bind`/`.TCPServer.start` is deprecated. See
`.TCPServer` docs for supported alternatives.
- `.AnyThreadEventLoopPolicy` is deprecated. This class controls the creation of
the "current" event loop so it will be removed when that concept is no longer
supported.
- `.IOLoop.make_current` and `.IOLoop.clear_current` are deprecated. In the
future the concept of a "current" event loop as distinct from one that is
currently running will be removed.
- ``TwistedResolver`` and ``CaresResolver`` are deprecated and will be
removed in Tornado 7.0.
General changes
~~~~~~~~~~~~~~~
- The minimum supported Python version is now 3.7.
- Wheels are now published with the Python stable ABI (``abi3``) for
compatibility across versions of Python.
- SSL certificate verfication and hostname checks are now enabled by default in
more places (primarily in client-side usage of `.SSLIOStream`).
- Various improvements to type hints throughout the package.
- CI has moved from Travis and Appveyor to Github Actions.
`tornado.gen`
~~~~~~~~~~~~~
- Fixed a bug in which ``WaitIterator.current_index`` could be incorrect.
- ``tornado.gen.TimeoutError``` is now an alias for `asyncio.TimeoutError`.
`tornado.http1connection`
~~~~~~~~~~~~~~~~~~~~~~~~~
- ``max_body_size`` may now be set to zero to disallow a non-empty body.
- ``Content-Encoding: gzip`` is now recognized case-insensitively.
`tornado.httpclient`
~~~~~~~~~~~~~~~~~~~~
- ``curl_httpclient`` now supports non-ASCII (ISO-8859-1) header values, same as
``simple_httpclient``.
`tornado.ioloop`
~~~~~~~~~~~~~~~~
- `.PeriodicCallback` now understands coroutines and will not start multiple
copies if a previous invocation runs too long.
- `.PeriodicCallback` now accepts `datetime.timedelta` objects in addition to
numbers of milliseconds.
- Avoid logging "Event loop is closed" during shutdown-related race conditions.
- Tornado no longer calls `logging.basicConfig` when starting an IOLoop; this
has been unnecessary since Python 3.2 added a logger of last resort.
- The `.IOLoop` constructor now accepts an ``asyncio_loop`` keyword argument to
initialize with a specfied asyncio event loop.
- It is now possible to construct an `.IOLoop` on one thread (with
``make_current=False``) and start it on a different thread.
`tornado.iostream`
~~~~~~~~~~~~~~~~~~
- `.SSLIOStream` now supports reading more than 2GB at a time.
- ``IOStream.write`` now supports typed `memoryview` objects.
`tornado.locale`
~~~~~~~~~~~~~~~~
- `.load_gettext_translations` no longer logs errors when language directories
exist but do not contain the expected file.
`tornado.netutil`
~~~~~~~~~~~~~~~~~
- `.is_valid_ip` no longer raises exceptions when the input is too long.
- The default resolver now uses the same methods (and thread pool) as `asyncio`.
`tornado.tcpserver`
~~~~~~~~~~~~~~~~~~~
- `.TCPServer.listen` now supports more arguments to pass through to
`.netutil.bind_sockets`.
`tornado.testing`
~~~~~~~~~~~~~~~~~
- `.bind_unused_port` now takes an optional ``address`` argument.
- Wrapped test methods now include the ``__wrapped__`` attribute.
`tornado.web`
~~~~~~~~~~~~~
- When using a custom `.StaticFileHandler` subclass, the ``reset()`` method is
now called on this subclass instead of the base class.
- Improved handling of the ``Accept-Language`` header.
- `.Application.listen` now supports more arguments to pass through to
`.netutil.bind_sockets`.
`tornado.websocket`
~~~~~~~~~~~~~~~~~~~
- `.WebSocketClientConnection.write_message` now accepts `dict` arguments for
consistency with `.WebSocketHandler.write_message`.
- `.WebSocketClientConnection.write_message` now raises an exception as
documented if the connection is already closed.
Merge pull request tornadoweb#3162 from bdarnell/6.2b2 Set version to 6.2b2
What's new in Tornado 6.2.0
Jun XX, 2022
------------
Deprecation notice
~~~~~~~~~~~~~~~~~~
- Python 3.10 has begun the process of significant changes to the APIs for
managing the event loop. Calls to methods such as `asyncio.get_event_loop` may
now raise `DeprecationWarning` if no event loop is running. This has
significant impact on the patterns for initializing applications, and in
particular invalidates patterns that have long been the norm in Tornado's
documentation and actual usage. In the future (with some as-yet-unspecified
future version of Python), the old APIs will be removed. The new recommended
pattern is to start the event loop with `asyncio.run`. More detailed migration
guides will be coming in the future.
- The `.IOLoop` constructor is deprecated. Use `.IOLoop.current` when the loop
is already running instead.
- `.AsyncTestCase` (and `.AsyncHTTPTestCase`) are deprecated. Use
`unittest.IsolatedAsyncioTestCase` instead.
- Multi-process `.TCPServer.bind`/`.TCPServer.start` is deprecated. See
`.TCPServer` docs for supported alternatives.
- `.AnyThreadEventLoopPolicy` is deprecated. This class controls the creation of
the "current" event loop so it will be removed when that concept is no longer
supported.
- `.IOLoop.make_current` and `.IOLoop.clear_current` are deprecated. In the
future the concept of a "current" event loop as distinct from one that is
currently running will be removed.
- ``TwistedResolver`` and ``CaresResolver`` are deprecated and will be
removed in Tornado 7.0.
General changes
~~~~~~~~~~~~~~~
- The minimum supported Python version is now 3.7.
- SSL certificate verfication and hostname checks are now enabled by default in
more places (primarily in client-side usage of `.SSLIOStream`).
- Various improvements to type hints throughout the package.
- CI has moved from Travis and Appveyor to Github Actions.
`tornado.gen`
~~~~~~~~~~~~~
- Fixed a bug in which ``WaitIterator.current_index`` could be incorrect.
- ``tornado.gen.TimeoutError``` is now an alias for `asyncio.TimeoutError`.
`tornado.http1connection`
~~~~~~~~~~~~~~~~~~~~~~~~~
- ``max_body_size`` may now be set to zero to disallow a non-empty body.
- ``Content-Encoding: gzip`` is now recognized case-insensitively.
`tornado.httpclient`
~~~~~~~~~~~~~~~~~~~~
- ``curl_httpclient`` now supports non-ASCII (ISO-8859-1) header values, same as
``simple_httpclient``.
`tornado.ioloop`
~~~~~~~~~~~~~~~~
- `.PeriodicCallback` now understands coroutines and will not start multiple
copies if a previous invocation runs too long.
- `.PeriodicCallback` now accepts `datetime.timedelta` objects in addition to
numbers of milliseconds.
- Avoid logging "Event loop is closed" during shutdown-related race conditions.
- Tornado no longer calls `logging.basicConfig` when starting an IOLoop; this
has been unnecessary since Python 3.2 added a logger of last resort.
`tornado.iostream`
~~~~~~~~~~~~~~~~~~
- `.SSLIOStream` now supports reading more than 2GB at a time.
- ``IOStream.write`` now supports typed `memoryview` objects.
`tornado.locale`
~~~~~~~~~~~~~~~~
- `.load_gettext_translations` no longer logs errors when language directories
exist but do not contain the expected file.
`tornado.netutil`
~~~~~~~~~~~~~~~~~
- `.is_valid_ip` no longer raises exceptions when the input is too long.
- The default resolver now uses the same methods (and thread pool) as `asyncio`.
`tornado.tcpserver`
~~~~~~~~~~~~~~~~~~~
- `.TCPServer.listen` now supports more arguments to pass through to
`.netutil.bind_sockets`.
`tornado.testing`
~~~~~~~~~~~~~~~~~
- `.bind_unused_port` now takes an optional ``address`` argument.
- Wrapped test methods now include the ``__wrapped__`` attribute.
`tornado.web`
~~~~~~~~~~~~~
- When using a custom `.StaticFileHandler` subclass, the ``reset()`` method is
now called on this subclass instead of the base class.
- Improved handling of the ``Accept-Language`` header.
- `.Application.listen` now supports more arguments to pass through to
`.netutil.bind_sockets`.
`tornado.websocket`
~~~~~~~~~~~~~~~~~~~
- `.WebSocketClientConnection.write_message` now accepts `dict` arguments for
consistency with `.WebSocketHandler.write_message`.
- `.WebSocketClientConnection.write_message` now raises an exception as
documented if the connection is already closed.
What's new in Tornado 6.1.0 Oct 30, 2020 ------------ Deprecation notice ~~~~~~~~~~~~~~~~~~ - This is the last release of Tornado to support Python 3.5. Future versions will require Python 3.6 or newer. General changes ~~~~~~~~~~~~~~~ - Windows support has been improved. Tornado is now compatible with the proactor event loop (which became the default in Python 3.8) by automatically falling back to running a selector in a second thread. This means that it is no longer necessary to explicitly configure a selector event loop, although doing so may improve performance. This does not change the fact that Tornado is significantly less scalable on Windows than on other platforms. - Binary wheels are now provided for Windows, MacOS, and Linux (amd64 and arm64). `tornado.gen` ~~~~~~~~~~~~~ - `.coroutine` now has better support for the Python 3.7+ ``contextvars`` module. In particular, the ``ContextVar.reset`` method is now supported. `tornado.http1connection` ~~~~~~~~~~~~~~~~~~~~~~~~~ - ``HEAD`` requests to handlers that used chunked encoding no longer produce malformed output. - Certain kinds of malformed ``gzip`` data no longer cause an infinite loop. `tornado.httpclient` ~~~~~~~~~~~~~~~~~~~~ - Setting ``decompress_response=False`` now works correctly with ``curl_httpclient``. - Mixing requests with and without proxies works correctly in ``curl_httpclient`` (assuming the version of pycurl is recent enough). - A default ``User-Agent`` of ``Tornado/$VERSION`` is now used if the ``user_agent`` parameter is not specified. - After a 303 redirect, ``tornado.simple_httpclient`` always uses ``GET``. Previously this would use ``GET`` if the original request was a ``POST`` and would otherwise reuse the original request method. For ``curl_httpclient``, the behavior depends on the version of ``libcurl`` (with the most recent versions using ``GET`` after 303 regardless of the original method). - Setting ``request_timeout`` and/or ``connect_timeout`` to zero is now supported to disable the timeout. `tornado.httputil` ~~~~~~~~~~~~~~~~~~ - Header parsing is now faster. - `.parse_body_arguments` now accepts incompletely-escaped non-ASCII inputs. `tornado.iostream` ~~~~~~~~~~~~~~~~~~ - `ssl.CertificateError` during the SSL handshake is now handled correctly. - Reads that are resolved while the stream is closing are now handled correctly. `tornado.log` ~~~~~~~~~~~~~ - When colored logging is enabled, ``logging.CRITICAL`` messages are now recognized and colored magenta. `tornado.netutil` ~~~~~~~~~~~~~~~~~ - ``EADDRNOTAVAIL`` is now ignored when binding to ``localhost`` with IPv6. This error is common in docker. `tornado.platform.asyncio` ~~~~~~~~~~~~~~~~~~~~~~~~~~ - `.AnyThreadEventLoopPolicy` now also configures a selector event loop for these threads (the proactor event loop only works on the main thread) ``tornado.platform.auto`` ~~~~~~~~~~~~~~~~~~~~~~~~~ - The ``set_close_exec`` function has been removed. `tornado.testing` ~~~~~~~~~~~~~~~~~ - `.ExpectLog` now has a ``level`` argument to ensure that the given log level is enabled. `tornado.web` ~~~~~~~~~~~~~ - ``RedirectHandler.get`` now accepts keyword arguments. - When sending 304 responses, more headers (including ``Allow``) are now preserved. - ``reverse_url`` correctly handles escaped characters in the regex route. - Default ``Etag`` headers are now generated with SHA-512 instead of MD5. `tornado.websocket` ~~~~~~~~~~~~~~~~~~~ - The ``ping_interval`` timer is now stopped when the connection is closed. - `.websocket_connect` now raises an error when it encounters a redirect instead of hanging.
Merge pull request tornadoweb#2940 from bdarnell/bump6.1b2 Bump version to 6.1b2
What's new in Tornado 6.1.0 Oct X, 2020 ----------- General changes ~~~~~~~~~~~~~~~ - Windows support has been improved. Tornado is now compatible with the proactor event loop (which became the default in Python 3.8) by automatically falling back to running a selector in a second thread. This means that it is no longer necessary to explicitly configure a selector event loop, although doing so may improve performance. This does not change the fact that Tornado is significantly less scalable on Windows than on other platforms. - Binary wheels are now provided for Windows, MacOS, and Linux (amd64 and arm64). `tornado.http1connection` ~~~~~~~~~~~~~~~~~~~~~~~~~ - ``HEAD`` requests to handlers that used chunked encoding no longer produce malformed output. - Certain kinds of malformed ``gzip`` data no longer cause an infinite loop. `tornado.httpclient` ~~~~~~~~~~~~~~~~~~~~ - Setting ``decompress_response=False`` now works correctly with ``curl_httpclient``. - Mixing requests with and without proxies works correctly in ``curl_httpclient`` (assuming the version of pycurl is recent enough). - A default ``User-Agent`` of ``Tornado/$VERSION`` is now used if the ``user_agent`` parameter is not specified. - After a 303 redirect, ``tornado.simple_httpclient`` always uses ``GET``. Previously this would use ``GET`` if the original request was a ``POST`` and would otherwise reuse the original request method. For ``curl_httpclient``, the behavior depends on the version of ``libcurl`` (with the most recent versions using ``GET`` after 303 regardless of the original method). - Setting ``request_timeout`` and/or ``connect_timeout`` to zero is now supported to disable the timeout. `tornado.httputil` ~~~~~~~~~~~~~~~~~~ - Header parsing is now faster. - `.parse_body_arguments` now accepts incompletely-escaped non-ASCII inputs. `tornado.iostream` ~~~~~~~~~~~~~~~~~~ - `ssl.CertificateError` during the SSL handshake is now handled correctly. - Reads that are resolved while the stream is closing are now handled correctly. `tornado.log` ~~~~~~~~~~~~~ - When colored logging is enabled, ``logging.CRITICAL`` messages are now recognized and colored magenta. `tornado.netutil` ~~~~~~~~~~~~~~~~~ - ``EADDRNOTAVAIL`` is now ignored when binding to ``localhost`` with IPv6. This error is common in docker. `tornado.platform.asyncio` ~~~~~~~~~~~~~~~~~~~~~~~~~~ - `.AnyThreadEventLoopPolicy` now also configures a selector event loop for these threads (the proactor event loop only works on the main thread) ``tornado.platform.auto`` ~~~~~~~~~~~~~~~~~~~~~~~~~ - The ``set_close_exec`` function has been removed. `tornado.testing` ~~~~~~~~~~~~~~~~~ - `.ExpectLog` now has a ``level`` argument to ensure that the given log level is enabled. `tornado.web` ~~~~~~~~~~~~~ - ``RedirectHandler.get`` now accepts keyword arguments. - When sending 304 responses, more headers (including ``Allow``) are now preserved. - ``reverse_url`` correctly handles escaped characters in the regex route. - Default ``Etag`` headers are now generated with SHA-512 instead of MD5. `tornado.websocket` ~~~~~~~~~~~~~~~~~~~ - The ``ping_interval`` timer is now stopped when the connection is closed. - `.websocket_connect` now raises an error when it encounters a redirect instead of hanging.
What's new in Tornado 6.0.4 Mar 3, 2020 ----------- General changes ~~~~~~~~~~~~~~~ - Binary wheels are now available for Python 3.8 on Windows. Note that it is still necessary to use ``asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())`` for this platform/version. Bug fixes ~~~~~~~~~ - Fixed an issue in `.IOStream` (introduced in 6.0.0) that resulted in ``StreamClosedError`` being incorrectly raised if a stream is closed mid-read but there is enough buffered data to satisfy the read. - `.AnyThreadEventLoopPolicy` now always uses the selector event loop on Windows.
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).
PreviousNext