Never use unittest2 on python 3 (it appears to not interoperate with
the standard unittest module). On python 2, use the same logic in
tornado.testing and tornado.test.util to select an implementation.
Fixes#1005.
Remove insecure cipher suites and disable TLS compression. The option
to disable compression was only added in Python 3.3 so we do not
pass the test on older versions, but we come as close as possible with
the APIs available.
Closes#1014.
If an OSError or IOError are instantiated without an errno value, e.g.
e = OSError(). The existing code would give an IndexError: tuple index
out of range. However there have been cases that the errno attribute
wasn't populated so instead of switching to it this introduces a helper
function to ensure we get the errno value through whatever means
possible.
Add tests and comments for how to disable this configuration.
Make it slightly easier to disable by making the command line
flag case-insensitive and allowing `None` instead of the string "none"
when setting the flag in code.
Closes#952.
This speeds things up in comparison to the _iostream_return_future
decorator by removing unnecessary abstraction and especially by allowing
Futures to bypass some of the hoops IOStream jumps through to ensure a
clean slate for its callbacks.
Since it is no longer possible for TracebackFuture to modify
concurrent.futures.Future instead, there is no need for separate
classes. Removing the subclass speeds things up a bit by removing
a level of indirection.
Also microoptimized a few methods of Future.
The runner alone can catch all necessary exceptions as long as Futures
are used; stack contexts are only needed for YieldPoints (especially
Callback/Wait; Task could be changed to use a local-only stack
context).
This is slightly backwards incompatible for code that assumes the existence
of a stack context without yielding anything.
The existing checks in StackContext.__exit__ are run after the damage has
been done and may raise exceptions in the wrong place; gen.Runner
is a more reliable place to detect this problem.
Throwing the exception into the generator provides a better stack trace
for the problem and also simplifies some of the complexity of testing for
this feature.
This improves performance of applications using @coroutine and Futures,
at the expense of some performance degradation for the older YieldPoint
interfaces.
This improves performance and provides more consistent semantics
(independent of the presence or absence of the concurrent.futures
package).
The parts of Tornado that accept Futures will accept both Tornado's
thread-unsafe Futures and the thread-safe concurrent.futures.Future.