Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 234 lines (177 sloc) 8.204 kb
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
1 What's new in the next version of Tornado
2 =========================================
3
4 In Progress
5 -----------
6
7 Backwards-compatibility notes
8 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9
10 * ``SSLIOStream.connect`` and `.IOStream.start_tls` now validate certificates
11 by default.
12 * Certificate validation will now use the system CA root certificates instead
13 of ``certifi`` when possible (i.e. Python 2.7.9+ or 3.4+). This includes
14 `.IOStream` and ``simple_httpclient``, but not ``curl_httpclient``.
15 * The default SSL configuration has become stricter, using
16 `ssl.create_default_context` where available.
b5b0b37 @bdarnell Update next-release notes
bdarnell authored
17 * The deprecated classes in the `tornado.auth` module, ``GoogleMixin``,
18 ``FacebookMixin``, and ``FriendFeedMixin`` have been removed.
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
19
2cd010f @ajdavis Notes for porting from Toro to Tornado.
ajdavis authored
20 New modules: `tornado.locks` and `tornado.queues`
21 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22
23 These modules provide classes for coordinating coroutines, merged from
24 `Toro <http://toro.readthedocs.org>`_.
25
26 To port your code from Toro's queues to Tornado 4.2, import `.Queue`,
27 `.PriorityQueue`, or `.LifoQueue` from `tornado.queues` instead of from
28 ``toro``.
29
30 Use `.Queue` instead of Toro's ``JoinableQueue``. In Tornado the methods
31 `~.Queue.join` and `~.Queue.task_done` are available on all queues, not on a
32 special ``JoinableQueue``.
33
34 Tornado queues raise exceptions specific to Tornado instead of reusing
35 exceptions from the Python standard library.
36 Therefore instead of catching the standard `queue.Empty` exception from
37 `.Queue.get_nowait`, catch the special `tornado.queues.QueueEmpty` exception,
38 and instead of catching the standard `queue.Full` from `.Queue.get_nowait`,
39 catch `tornado.queues.QueueFull`.
40
41 To port from Toro's locks to Tornado 4.2, import `.Condition`, `.Event`,
42 `.Semaphore`, `.BoundedSemaphore`, or `.Lock` from `tornado.locks`
43 instead of from ``toro``.
44
45 Toro's ``Semaphore.wait`` allowed a coroutine to wait for the semaphore to
46 be unlocked *without* acquiring it. This encouraged unorthodox patterns; in
47 Tornado, just use `~.Semaphore.acquire`.
48
85ff3a0 @ajdavis More detail about porting from toro.Event.
ajdavis authored
49 Toro's ``Event.wait`` raised a ``Timeout`` exception after a timeout. In
50 Tornado, `.Event.wait` raises `tornado.gen.TimeoutError`.
51
52 Toro's ``Condition.wait`` also raised ``Timeout``, but in Tornado, the `.Future`
53 returned by `.Condition.wait` resolves to False after a timeout::
2cd010f @ajdavis Notes for porting from Toro to Tornado.
ajdavis authored
54
55 @gen.coroutine
56 def await_notification():
57 if not (yield condition.wait(timeout=timedelta(seconds=1))):
58 print('timed out')
59 else:
60 print('condition is true')
61
62 In lock and queue methods, wherever Toro accepted ``deadline`` as a keyword
63 argument, Tornado names the argument ``timeout`` instead.
64
65 Toro's ``AsyncResult`` is not merged into Tornado, nor its exceptions
66 ``NotReady`` and ``AlreadySet``. Use a `.Future` instead. If you wrote code like
67 this::
68
69 from tornado import gen
70 import toro
71
72 result = toro.AsyncResult()
73
74 @gen.coroutine
75 def setter():
76 result.set(1)
77
78 @gen.coroutine
79 def getter():
80 value = yield result.get()
81 print(value) # Prints "1".
82
83 Then the Tornado equivalent is::
84
85 from tornado import gen
86 from tornado.concurrent import Future
87
88 result = Future()
89
90 @gen.coroutine
91 def setter():
92 result.set_result(1)
93
94 @gen.coroutine
95 def getter():
96 value = yield result
97 print(value) # Prints "1".
98
b5b0b37 @bdarnell Update next-release notes
bdarnell authored
99 `tornado.autoreload`
100 ~~~~~~~~~~~~~~~~~~~~
101
102 * Improved compatibility with Windows.
7b2f996 @bdarnell Update release notes
bdarnell authored
103 * Fixed a bug in Python 3 if a module was imported during a reload check.
104
105 `tornado.concurrent`
106 ~~~~~~~~~~~~~~~~~~~~
107
108 * `.run_on_executor` now accepts arguments to control which attributes
109 it uses to find the `.IOLoop` and executor.
110
5600fde @bdarnell More doc updates.
bdarnell authored
111 `tornado.curl_httpclient`
112 ~~~~~~~~~~~~~~~~~~~~~~~~~
7b2f996 @bdarnell Update release notes
bdarnell authored
113
114 * Fixed a bug that would cause the client to stop processing requests
115 if an exception occurred in certain places while there is a queue.
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
116
117 `tornado.gen`
118 ~~~~~~~~~~~~~
119
120 * On Python 3, catching an exception in a coroutine no longer leads to
121 leaks via ``Exception.__context__``.
7b2f996 @bdarnell Update release notes
bdarnell authored
122 * `tornado.gen.Multi` and `tornado.gen.multi_future` (which are used when
123 yielding a list or dict in a coroutine) now log any exceptions after the
124 first if more than one `.Future` fails (previously they would be logged
125 when the `.Future` was garbage-collected, but this is more reliable).
126 Both have a new keyword argument ``quiet_exceptions`` to suppress
127 logging of certain exception types; to use this argument you must
128 call ``Multi`` or ``multi_future`` directly instead of simply yielding
129 a list.
130 * `.multi_future` now works when given multiple copies of the same `.Future`.
131 * `.WaitIterator` now works even if no hard reference to the iterator itself
132 is kept.
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
133
b5b0b37 @bdarnell Update next-release notes
bdarnell authored
134 `tornado.httpclient`
135 ~~~~~~~~~~~~~~~~~~~~
136
137 * The ``raise_error`` argument now works correctly with the synchronous
138 `.HTTPClient`.
139
140 `tornado.httpserver`
141 ~~~~~~~~~~~~~~~~~~~~
142
143 * `.HTTPServer` is now a subclass of `tornado.util.Configurable`.
144
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
145 `tornado.ioloop`
146 ~~~~~~~~~~~~~~~~
147
148 * `.PeriodicCallback` is now more efficient when the clock jumps forward
149 by a large amount.
7b2f996 @bdarnell Update release notes
bdarnell authored
150 * The `.IOLoop` constructor now has a ``make_current`` keyword argument
151 to control whether the new `.IOLoop` becomes `.IOLoop.current()`.
152 * Third-party implementations of `.IOLoop` should accept ``**kwargs``
153 in their `~.IOLoop.initialize` methods and pass them to the superclass
154 implementation.
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
155
156 `tornado.iostream`
157 ~~~~~~~~~~~~~~~~~~
158
159 * ``SSLIOStream.connect`` and `.IOStream.start_tls` now validate certificates
160 by default.
b5b0b37 @bdarnell Update next-release notes
bdarnell authored
161 * New method `.SSLIOStream.wait_for_handshake` allows server-side applications
162 to wait for the handshake to complete in order to verify client certificates
163 or use NPN/ALPN.
164 * The `.Future` returned by ``SSLIOStream.connect`` now resolves after the
165 handshake is complete instead of as soon as the TCP connection is
166 established.
167 * Reduced logging of SSL errors.
168 * `.BaseIOStream.read_until_close` now works correctly when a
169 ``streaming_callback`` is given but ``callback`` is None (i.e. when
170 it returns a `.Future`)
171
172 `tornado.locale`
173 ~~~~~~~~~~~~~~~~
174
175 * New method `.GettextLocale.pgettext` allows additional context to be
176 supplied for gettext translations.
177
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
178 `tornado.log`
179 ~~~~~~~~~~~~~
180
181 * `.define_logging_options` now works correctly when given a non-default
182 ``options`` object.
183
b5b0b37 @bdarnell Update next-release notes
bdarnell authored
184 `tornado.process`
185 ~~~~~~~~~~~~~~~~~
186
187 * New method `.Subprocess.wait_for_exit` is a coroutine-friendly
188 version of `.Subprocess.set_exit_callback`.
189
5600fde @bdarnell More doc updates.
bdarnell authored
190 `tornado.simple_httpclient`
191 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
192
193 * Improved performance on Python 3 by reusing a single `ssl.SSLContext`.
7b2f996 @bdarnell Update release notes
bdarnell authored
194 * New constructor argument ``max_body_size`` controls the maximum response
195 size the client is willing to accept. It may be bigger than
196 ``max_buffer_size`` if ``streaming_callback`` is used.
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
197
b5b0b37 @bdarnell Update next-release notes
bdarnell authored
198 `tornado.tcpserver`
199 ~~~~~~~~~~~~~~~~~~~
200
201 * `.TCPServer.handle_stream` may be a coroutine (so that any exceptions
202 it raises will be logged).
203
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
204 `tornado.util`
205 ~~~~~~~~~~~~~~
206
207 * `.import_object` now supports unicode strings on Python 2.
b5b0b37 @bdarnell Update next-release notes
bdarnell authored
208 * `.Configurable.initialize` now supports positional arguments.
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
209
210 `tornado.web`
211 ~~~~~~~~~~~~~
212
213 * Passing ``secure=False`` or ``httponly=False`` to
214 `.RequestHandler.set_cookie` now works as expected (previously only the
215 presence of the argument was considered and its value was ignored).
b5b0b37 @bdarnell Update next-release notes
bdarnell authored
216 * Parsing of the ``If-None-Match`` header now follows the RFC and supports
217 weak validators.
218 * `.RequestHandler.get_arguments` now requires that its ``strip`` argument
219 be of type bool. This helps prevent errors caused by the slightly dissimilar
220 interfaces between the singular and plural methods.
221 * Errors raised in ``_handle_request_exception`` are now logged more reliably.
222 * `.RequestHandler.redirect` now works correctly when called from a handler
223 whose path begins with two slashes.
224 * Passing messages containing ``%`` characters to `tornado.web.HTTPError`
225 no longer causes broken error messages.
f3a7816 @martinhoefling Documentation for key versioning added
martinhoefling authored
226 * Key versioning support for cookie signing. ``cookie_secret`` application
227 setting can now contain a dict of valid keys with version as key. The
228 current signing key then must be specified via ``key_version`` setting.
dcd1ef8 @bdarnell Start next-release notes
bdarnell authored
229
230 `tornado.websocket`
231 ~~~~~~~~~~~~~~~~~~~
232
233 * The ``on_close`` method will no longer be called more than once.
Something went wrong with that request. Please try again.