From: Ben Darnell Date: Mon, 4 Nov 2013 02:10:56 +0000 (-0500) Subject: Update next-release notes. X-Git-Tag: v3.2.0b1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd8c2918a24a25421f538986aa7787f263a8538e;p=thirdparty%2Ftornado.git Update next-release notes. --- diff --git a/docs/releases/next.rst b/docs/releases/next.rst index f64a0289c..0a4638ea3 100644 --- a/docs/releases/next.rst +++ b/docs/releases/next.rst @@ -31,4 +31,42 @@ In Progress arguments, just like `~.RequestHandler.clear_cookie`. * The embedded ``ca-certificats.crt`` file has been updated with the current Mozilla CA list. -* `.GoogleOAuth2Mixin` has been added so that Google's OAuth2 only apps are able to get a context without OpenID (which uses OAuth 1). +* `.GoogleOAuth2Mixin` has been added so that Google's OAuth2 only apps are + able to get a context without OpenID (which uses OAuth 1). +* `.WebSocketHandler.write_message` now raises `.WebSocketClosedError` instead + of `AttributeError` when the connection has been closed. +* ``simple_httpclient`` now applies the ``connect_timeout`` to requests + that are queued and have not yet started. +* `.is_valid_ip` (and therefore ``HTTPRequest.remote_ip``) now rejects + empty strings. +* `.websocket_connect` now accepts preconstructed ``HTTPRequest`` objects. +* Fix a bug with `.WebSocketHandler` when used with some proxies that + unconditionally modify the ``Connection`` header. +* New application setting ``default_handler_class`` can be used to easily + set up custom 404 pages. +* Fix some error messages for unix sockets (and other non-IP sockets) +* New application settings ``autoreload``, ``compiled_template_cache``, + ``static_hash_cache``, and ``serve_traceback`` can be used to control + individual aspects of debug mode. +* New methods `.RequestHandler.get_query_argument` and + `.RequestHandler.get_body_argument` and new attributes + `.HTTPRequest.query_arguments` and `.HTTPRequest.body_arguments` allow access + to arguments without intermingling those from the query string with those + from the request body. +* `.websocket_connect` now returns an error immediately for refused connections + instead of waiting for the timeout. +* Exceptions will no longer be logged twice when using both ``@asynchronous`` + and ``@gen.coroutine`` +* Swallow a spurious exception from ``set_nodelay`` when a connection + has been reset. +* Coroutines may now yield dicts in addition to lists to wait for + multiple tasks in parallel. +* Fix an error from `tornado.log.enable_pretty_logging` when + `sys.stderr` does not have an ``isatty`` method. +* `.WebSocketClientConnection` now has a ``close`` method. +* It is now possible to specify handlers by name when using the `.URLSpec` + class. +* On Python 2.6, ``simple_httpclient`` now uses TLSv1 instead of SSLv3. +* Added `.GoogleOAuth2Mixin` support authentication to Google services + with OAuth 2 instead of OpenID and OAuth 1. +* TODO: document asyncio and C extension module. diff --git a/docs/web.rst b/docs/web.rst index d9a43c7c2..b62f2b57e 100644 --- a/docs/web.rst +++ b/docs/web.rst @@ -131,8 +131,17 @@ General settings: - * ``debug``: If ``True`` the application runs in debug mode, - described in :ref:`debug-mode`. + * ``autoreload``: If ``True``, the server process will restart + when any source files change, as described in :ref:`debug-mode`. + This option is new in Tornado 3.2; previously this functionality + was controlled by the ``debug`` setting. + * ``debug``: Shorthand for several debug mode settings, + described in :ref:`debug-mode`. Setting ``debug=True`` is + equivalent to ``autoreload=True``, ``compiled_template_cache=False``, + ``static_hash_cache=False``, ``serve_traceback=True``. + * ``default_handler_class`` and ``default_handler_args``: + This handler will be used if no other match is found; + use this to implement custom 404 pages (new in Tornado 3.2). * ``gzip``: If ``True``, responses in textual formats will be gzipped automatically. * ``log_function``: This function will be called at the end @@ -140,6 +149,10 @@ `RequestHandler` object). The default implementation writes to the `logging` module's root logger. May also be customized by overriding `Application.log_request`. + * ``serve_traceback``: If true, the default error page + will include the traceback of the error. This option is new in + Tornado 3.2; previously this functionality was controlled by + the ``debug`` setting. * ``ui_modules`` and ``ui_methods``: May be set to a mapping of `UIModule` or UI methods to be made available to templates. May be set to a module, dictionary, or a list of modules @@ -166,6 +179,10 @@ of a function that all output should be passed through. Defaults to ``"xhtml_escape"``. Can be changed on a per-template basis with the ``{% autoescape %}`` directive. + * ``compiled_template_cache``: Default is ``True``; if ``False`` + templates will be recompiled on every request. This option + is new in Tornado 3.2; previously this functionality was controlled + by the ``debug`` setting. * ``template_path``: Directory containing template files. Can be further customized by overriding `RequestHandler.get_template_path` * ``template_loader``: Assign to an instance of @@ -176,6 +193,10 @@ Static file settings: + * ``static_hash_cache``: Default is ``True``; if ``False`` + static urls will be recomputed on every request. This option + is new in Tornado 3.2; previously this functionality was controlled + by the ``debug`` setting. * ``static_path``: Directory from which static files will be served. * ``static_url_prefix``: Url prefix for static files, diff --git a/docs/websocket.rst b/docs/websocket.rst index e906af907..219254966 100644 --- a/docs/websocket.rst +++ b/docs/websocket.rst @@ -32,6 +32,7 @@ .. automethod:: WebSocketHandler.async_callback .. automethod:: WebSocketHandler.ping .. automethod:: WebSocketHandler.on_pong + .. autoexception:: WebSocketClosedError Client-side support diff --git a/tornado/gen.py b/tornado/gen.py index 448576a78..217ebdf59 100644 --- a/tornado/gen.py +++ b/tornado/gen.py @@ -52,6 +52,9 @@ be returned when they are all finished:: response3 = response_dict['response3'] response4 = response_dict['response4'] +.. versionchanged:: 3.2 + Dict support added. + For more complicated interfaces, `Task` can be split into two parts: `Callback` and `Wait`:: diff --git a/tornado/httpserver.py b/tornado/httpserver.py index f6e470807..34e7b7685 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -407,6 +407,20 @@ class HTTPRequest(object): `.RequestHandler.get_argument`, which returns argument values as unicode strings. + .. attribute:: query_arguments + + Same format as ``arguments``, but contains only arguments extracted + from the query string. + + .. versionadded:: 3.2 + + .. attribute:: body_arguments + + Same format as ``arguments``, but contains only arguments extracted + from the request body. + + .. versionadded:: 3.2 + .. attribute:: files File uploads are available in the files property, which maps file diff --git a/tornado/web.py b/tornado/web.py index 32cfcfcfe..a19e75f03 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -370,6 +370,8 @@ class RequestHandler(object): last value. The returned value is always unicode. + + .. versionadded:: 3.2 """ return self._get_argument(name, default, self.request.body_arguments, strip) @@ -379,6 +381,8 @@ class RequestHandler(object): If the argument is not present, returns an empty list. The returned values are always unicode. + + .. versionadded:: 3.2 """ return self._get_arguments(name, self.request.body_arguments, strip) @@ -393,6 +397,8 @@ class RequestHandler(object): last value. The returned value is always unicode. + + .. versionadded:: 3.2 """ return self._get_argument(name, default, self.request.query_arguments, strip) @@ -402,6 +408,8 @@ class RequestHandler(object): If the argument is not present, returns an empty list. The returned values are always unicode. + + .. versionadded:: 3.2 """ return self._get_arguments(name, self.request.query_arguments, strip) @@ -2542,12 +2550,12 @@ class URLSpec(object): assert len(self.regex.groupindex) in (0, self.regex.groups), \ ("groups in url regexes must either be all named or all " "positional: %r" % self.regex.pattern) - + if isinstance(handler, str): # import the Module and instantiate the class # Must be a fully qualified name (module.ClassName) handler = import_object(handler) - + self.handler_class = handler self.kwargs = kwargs or {} self.name = name diff --git a/tornado/websocket.py b/tornado/websocket.py index ac6af5f3b..e39424240 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -52,6 +52,10 @@ class WebSocketError(Exception): class WebSocketClosedError(WebSocketError): + """Raised by operations on a closed connection. + + .. versionadded:: 3.2 + """ pass @@ -163,6 +167,12 @@ class WebSocketHandler(tornado.web.RequestHandler): encoded as json). If the ``binary`` argument is false, the message will be sent as utf8; in binary mode any byte string is allowed. + + If the connection is already closed, raises `WebSocketClosedError`. + + .. versionchanged:: 3.2 + `WebSocketClosedError` was added (previously a closed connection + would raise an `AttributeError`) """ if self.ws_connection is None: raise WebSocketClosedError() @@ -781,7 +791,10 @@ class WebSocketClientConnection(simple_httpclient._HTTPConnection): 104857600, self.resolver) def close(self): - """Closes the websocket connection.""" + """Closes the websocket connection. + + .. versionadded:: 3.2 + """ if self.protocol is not None: self.protocol.close() self.protocol = None @@ -853,6 +866,9 @@ def websocket_connect(url, io_loop=None, callback=None, connect_timeout=None): Takes a url and returns a Future whose result is a `WebSocketClientConnection`. + + .. versionchanged:: 3.2 + Also accepts ``HTTPRequest`` objects in place of urls. """ if io_loop is None: io_loop = IOLoop.current()