What’s new in Tornado 2.4¶
Sep 4, 2012¶
General¶
- Fixed Python 3 bugs in
tornado.auth,tornado.locale, andtornado.wsgi.
HTTP clients¶
- Removed
max_simultaneous_connectionsargument fromtornado.httpclient(both implementations). This argument hasn’t been useful for some time (if you were using it you probably wantmax_clientsinstead) tornado.simple_httpclientnow accepts and ignores HTTP 1xx status responses.
tornado.ioloop and tornado.iostream¶
- Fixed a bug introduced in 2.3 that would cause
IOStreamclose callbacks to not run if there were pending reads. - Improved error handling in
SSLIOStreamand SSL-enabledTCPServer. SSLIOStream.get_ssl_certificatenow has abinary_formargument which is passed toSSLSocket.getpeercert.SSLIOStream.writecan now be called while the connection is in progress, same as non-SSLIOStream(but be careful not to send sensitive data until the connection has completed and the certificate has been verified).IOLoop.add_handlercannot be called more than once with the same file descriptor. This was always true forepoll, but now the other implementations enforce it too.- On Windows,
TCPServerusesSO_EXCLUSIVEADDRUSERinstead ofSO_REUSEADDR.
tornado.template¶
{% break %}and{% continue %}can now be used looping constructs in templates.- It is no longer an error for an if/else/for/etc block in a template to have an empty body.
tornado.testing¶
- New class
tornado.testing.AsyncHTTPSTestCaseis likeAsyncHTTPTestCase. but enables SSL for the testing server (by default using a self-signed testing certificate). tornado.testing.mainnow accepts additional keyword arguments and forwards them tounittest.main.
tornado.web¶
- New method
RequestHandler.get_template_namespacecan be overridden to add additional variables without modifying keyword arguments torender_string. RequestHandler.add_headernow works withWSGIApplication.RequestHandler.get_secure_cookienow handles a potential error case.RequestHandler.__init__now callssuper().__init__to ensure that all constructors are called when multiple inheritance is used.- Docs have been updated with a description of all available
Application settings
Other modules¶
OAuthMixinnow accepts"oob"as acallback_uri.OpenIdMixinnow also returns theclaimed_idfield for the user.tornado.platform.twistedshutdown sequence is now more compatible.- The logging configuration used in
tornado.optionsis now more tolerant of non-ascii byte strings.