What’s new in Tornado 6.2.0¶
Jul 3, 2022¶
April 2023 update: Python 3.12 reversed some of the changes described below. In Tornado 6.3,
AsyncHTTPTestCase, and the behavior of the
IOLoopconstructor related to the
make_currentparameter are no longer deprecated.
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_loopmay now raise
DeprecationWarningif 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.
AnyThreadEventLoopPolicyis deprecated. This class controls the creation of the “current” event loop so it will be removed when that concept is no longer supported.
CaresResolverare deprecated and will be removed in Tornado 7.0.
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 verification and hostname checks are now enabled by default in more places (primarily in client-side usage of
Various improvements to type hints throughout the package.
CI has moved from Travis and Appveyor to Github Actions.
Fixed a bug in which
WaitIterator.current_indexcould be incorrect.
tornado.gen.TimeoutErroris now an alias for
max_body_sizemay now be set to zero to disallow a non-empty body.
Content-Encoding: gzipis now recognized case-insensitively.
curl_httpclientnow supports non-ASCII (ISO-8859-1) header values, same as
PeriodicCallbacknow understands coroutines and will not start multiple copies if a previous invocation runs too long.
Avoid logging “Event loop is closed” during shutdown-related race conditions.
Tornado no longer calls
logging.basicConfigwhen starting an IOLoop; this has been unnecessary since Python 3.2 added a logger of last resort.
IOLoopconstructor now accepts an
asyncio_loopkeyword argument to initialize with a specfied asyncio event loop.
It is now possible to construct an
IOLoopon one thread (with
make_current=False) and start it on a different thread.
load_gettext_translationsno longer logs errors when language directories exist but do not contain the expected file.
bind_unused_portnow takes an optional
Wrapped test methods now include the