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¶
coroutinenow has better support for the Python 3.7+contextvarsmodule. In particular, theContextVar.resetmethod is now supported.
tornado.http1connection¶
HEADrequests to handlers that used chunked encoding no longer produce malformed output.Certain kinds of malformed
gzipdata no longer cause an infinite loop.
tornado.httpclient¶
Setting
decompress_response=Falsenow works correctly withcurl_httpclient.Mixing requests with and without proxies works correctly in
curl_httpclient(assuming the version of pycurl is recent enough).A default
User-AgentofTornado/$VERSIONis now used if theuser_agentparameter is not specified.After a 303 redirect,
tornado.simple_httpclientalways usesGET. Previously this would useGETif the original request was aPOSTand would otherwise reuse the original request method. Forcurl_httpclient, the behavior depends on the version oflibcurl(with the most recent versions usingGETafter 303 regardless of the original method).Setting
request_timeoutand/orconnect_timeoutto zero is now supported to disable the timeout.
tornado.httputil¶
Header parsing is now faster.
parse_body_argumentsnow accepts incompletely-escaped non-ASCII inputs.
tornado.iostream¶
ssl.CertificateErrorduring 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.CRITICALmessages are now recognized and colored magenta.
tornado.netutil¶
EADDRNOTAVAILis now ignored when binding tolocalhostwith IPv6. This error is common in docker.
tornado.platform.asyncio¶
AnyThreadEventLoopPolicynow 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_execfunction has been removed.
tornado.testing¶
ExpectLognow has alevelargument to ensure that the given log level is enabled.
tornado.web¶
RedirectHandler.getnow accepts keyword arguments.When sending 304 responses, more headers (including
Allow) are now preserved.reverse_urlcorrectly handles escaped characters in the regex route.Default
Etagheaders are now generated with SHA-512 instead of MD5.
tornado.websocket¶
The
ping_intervaltimer is now stopped when the connection is closed.websocket_connectnow raises an error when it encounters a redirect instead of hanging.