Tornado 2.4 新特性¶

    HTTP clients¶

    • tornado.simple_httpclient now accepts and ignores HTTP 1xx statusresponses.
    • Fixed a bug introduced in 2.3 that would cause IOStream close callbacksto not run if there were pending reads.
    • Improved error handling in and SSL-enabled TCPServer.
    • SSLIOStream.get_ssl_certificate now has a binary_form argumentwhich is passed to SSLSocket.getpeercert.
    • SSLIOStream.write can now be called while the connection is in progress,same as non-SSL (but be careful not to send sensitive data untilthe connection has completed and the certificate has been verified).
    • IOLoop.add_handler cannot be called more than once with the same filedescriptor. This was always true for epoll, but now the otherimplementations enforce it too.
    • On Windows, uses SO_EXCLUSIVEADDRUSER instead of SO_REUSEADDR.

    tornado.template¶

    • {% break %} and {% continue %} can now be used looping constructsin templates.
    • It is no longer an error for an if/else/for/etc block in a template tohave an empty body.
    • now accepts additional keyword arguments and forwardsthem to unittest.main.

    tornado.web¶

    • New method RequestHandler.get_template_namespace can be overridden toadd additional variables without modifying keyword arguments torender_string.
    • now works with WSGIApplication.
    • now handles a potential error case.
    • RequestHandler.init now calls super().init to ensure thatall constructors are called when multiple inheritance is used.
    • Docs have been updated with a description of all availableApplication settings
    • now accepts "oob" as a callback_uri.
    • OpenIdMixin now also returns the claimed_id field for the user.
    • shutdown sequence is now more compatible.