Tornado 1.2 新特性¶

Feb 20, 2011¶

  1. We are pleased to announce the release of Tornado 1.2, available from
  2. https://github.com/downloads/facebook/tornado/tornado-1.2.tar.gz
  3.  
  4. Backwards compatibility notes:
  5. * This release includes the backwards-incompatible security change from
  6. version 1.1.1. Users upgrading from 1.1 or earlier should read the
  7. release notes from that release:
  8. http://groups.google.com/group/python-tornado/browse_thread/thread/b36191c781580cde
  9. * StackContexts that do something other than catch exceptions may need to
  10. be modified to be reentrant.
  11. https://github.com/tornadoweb/tornado/commit/7a7e24143e77481d140fb5579bc67e4c45cbcfad
  12. * When XSRF tokens are used, the token must also be present on PUT and
  13. DELETE requests (anything but GET and HEAD)
  14.  
  15. New features:
  16. * A new HTTP client implementation is available in the module
  17. tornado.simple_httpclient. This HTTP client does not depend on pycurl.
  18. It has not yet been tested extensively in production, but is intended
  19. to eventually replace the pycurl-based HTTP client in a future release of
  20. Tornado. To transparently replace tornado.httpclient.AsyncHTTPClient with
  21. this new implementation, you can set the environment variable
  22. USE_SIMPLE_HTTPCLIENT=1 (note that the next release of Tornado will
  23. likely include a different way to select HTTP client implementations)
  24. * Request logging is now done by the Application rather than the
  25. RequestHandler. Logging behavior may be customized by either overriding
  26. Application.log_request in a subclass or by passing log_function
  27. as an Application setting
  28. * Application.listen(port): Convenience method as an alternative to
  29. explicitly creating an HTTPServer
  30. * tornado.escape.linkify(): Wrap urls in <a> tags
  31. * RequestHandler.create_signed_value(): Create signatures like the
  32. secure_cookie methods without setting cookies.
  33. * tornado.testing.get_unused_port(): Returns a port selected in the same
  34. way as inAsyncHTTPTestCase
  35. * AsyncHTTPTestCase.fetch(): Convenience method for synchronous fetches
  36. * IOLoop.set_blocking_signal_threshold(): Set a callback to be run when
  37. the IOLoop is blocked.
  38. * IOStream.connect(): Asynchronously connect a client socket
  39. * AsyncHTTPClient.handle_callback_exception(): May be overridden
  40. in subclass for custom error handling
  41. * httpclient.HTTPRequest has two new keyword arguments, validate_cert and
  42. ca_certs. Setting validate_cert=False will disable all certificate checks
  43. when fetching https urls. ca_certs may be set to a filename containing
  44. trusted certificate authorities (defaults will be used if this is
  45. unspecified)
  46. * HTTPRequest.get_ssl_certificate(): Returns the client's SSL certificate
  47. (if client certificates were requested in the server's ssl_options
  48. * StaticFileHandler can be configured to return a default file (e.g.
  49. index.html) when a directory is requested
  50. * Template directives of the form "{% from x import y %}" are now
  51. supported (in addition to the existing support for "{% import x
  52. %}"
  53. * FacebookGraphMixin.get_authenticated_user now accepts a new
  54. parameter 'extra_fields' which may be used to request additional
  55. information about the user
  56.  
  57. Bug fixes:
  58. * auth: Fixed KeyError with Facebook offline_access
  59. * auth: Uses request.uri instead of request.path as the default redirect
  60. so that parameters are preserved.
  61. * escape: xhtml_escape() now returns a unicode string, not
  62. utf8-encoded bytes
  63. * ioloop: Callbacks added with add_callback are now run in the order they
  64. were added
  65. * ioloop: PeriodicCallback.stop can now be called from inside the callback.
  66. * iostream: Fixed several bugs in SSLIOStream
  67. * iostream: Detect when the other side has closed the connection even with
  68. the select()-based IOLoop
  69. * iostream: read_bytes(0) now works as expected
  70. * iostream: Fixed bug when writing large amounts of data on windows
  71. * iostream: Fixed infinite loop that could occur with unhandled exceptions
  72. * httpclient: Fix bugs when some requests use proxies and others don't
  73. * httpserver: HTTPRequest.protocol is now set correctly when using the
  74. built-in SSL support
  75. * httpserver: When using multiple processes, the standard library's
  76. random number generator is re-seeded in each child process
  77. * httpserver: With xheaders enabled, X-Forwarded-Proto is supported as an
  78. alternative to X-Scheme
  79. * httpserver: Fixed bugs in multipart/form-data parsing
  80. * locale: format_date() now behaves sanely with dates in the future
  81. * locale: Updates to the language list
  82. * stack_context: Fixed bug with contexts leaking through reused IOStreams
  83. * stack_context: Simplified semantics and improved performance
  84. * web: The order of css_files from UIModules is now preserved
  85. * web: Fixed error with default_host redirect
  86. * web: StaticFileHandler works when os.path.sep != '/' (i.e. on Windows)
  87. * web: Fixed a caching-related bug in StaticFileHandler when a file's
  88. timestamp has changed but its contents have not.
  89. * web: Fixed bugs with HEAD requests and e.g. Etag headers
  90. * web: Fix bugs when different handlers have different static_paths
  91. * web: @removeslash will no longer cause a redirect loop when applied to the
  92. root path
  93. * websocket: Now works over SSL
  94. * websocket: Improved compatibility with proxies
  95.  
  96. Many thanks to everyone who contributed patches, bug reports, and feedback
  97. that went into this release!
  98.  
  99. -Ben

原文:

https://tornado-zh-cn.readthedocs.io/zh_CN/latest/releases/v1.2.0.html