No need to utf8() what is passed to WRITEFUNCTION, it will always
be bytes on python3 for upstream pycurl on python3.
The ubuntu-12.10 variant is long gone.
Ben Darnell [Sun, 20 May 2018 18:37:09 +0000 (14:37 -0400)]
httpclient: Improve non-ascii characters in HTTP auth
- Use NFC as required by the spec
- Fix string-concat exceptions on py2
- Test both curl and simple http clients for basic auth
- Do the same for proxy auth in curl
Ben Darnell [Sun, 20 May 2018 15:10:45 +0000 (11:10 -0400)]
test: Fix ResolveTimeoutTestCase
The dummy resolver used here was not correctly adapted for changes in
netutil, and as a result the test was incorrect (it checked for
TypeError instead of a timeout) and flaky (occasionally it would get a
timeout error anyway).
Ben Darnell [Sun, 20 May 2018 03:28:45 +0000 (23:28 -0400)]
autoreload: Improve autoreload wrapper on windows
On platforms without execv(), we must spawn a separate subprocess.
This breaks down when an internal autoreload is firing in a wrapped
process, since the internal reload raises an exception with the
wrapper catches (triggering a second reload and another copy of the
process).
Ben Darnell [Sat, 19 May 2018 14:24:13 +0000 (10:24 -0400)]
autoreload: Fix wrapper preservation for Python 3
The `spec` branch needs special handling too. Update the test to
correctly test the desired situation (and simplify by removing the
separate toucher process).
peacetara [Thu, 17 May 2018 17:09:36 +0000 (10:09 -0700)]
add expires docs to set_cookie.
update set_cookie docstring to explain what expires will accept and behave properly, without having to go track down httputil.format_timestamp, which is not exposed in the docs(that I could find).
Ben Darnell [Sat, 12 May 2018 18:43:58 +0000 (14:43 -0400)]
websocket: Improve subprotocol support
- Add client-side subprotocol option
- Add selected_subprotocol attribute to client and server objects
- Call select_subprotocol exactly once instead of only on non-empty
- Fix bug in previous select_subprotocol change when multiple
subprotocols are offered
- Add tests
Ben Darnell [Sat, 5 May 2018 18:10:33 +0000 (14:10 -0400)]
wsgi: Deprecate WSGIAdapter and WSGIApplication
It's already kind of broken on Python 3 for multithreaded WSGI
containers, and it's going to be more difficult to maintain as we move
to native coroutines.
Alexei Pertsev [Thu, 3 May 2018 15:33:30 +0000 (18:33 +0300)]
Use `log_exception` method in WebSocketProtocol instead of
custom logging. It is usefull if we need to add some custom
handlers for all unexpected exceptions for example.
Ben Darnell [Fri, 27 Apr 2018 16:08:23 +0000 (12:08 -0400)]
stack_context: Deprecate ExceptionStackContext
Take extra care with the deprecation warnings since a few modules need
to continue using ExceptionStackContext for backwards compatibility
even though it is not needed in most cases and should not generate
warnings unless it is relied upon.
Ben Darnell [Sun, 22 Apr 2018 01:58:32 +0000 (21:58 -0400)]
iostream: Deprecate streaming_callback arguments
Currently, mixing futures and streaming_callback does not guarantee
ordering (so the returned future could become ready before the last
streaming_callback fires). Specifically, this happens with
test_streaming_read_until_close_after_close if that test is modified
to not use the callback argument. This would cause problems when we
remove the callback argument if we left streaming_callback in place.
These problems are solvable, but probably not worth it since
partial=True is an alternative (and used internally instead of
streaming_callback).
Ben Darnell [Sun, 22 Apr 2018 01:00:54 +0000 (21:00 -0400)]
iostream: Deprecate callback arguments to read methods
This requires a lot of mechanical changes throughout the test suite.
tornado.websocket is currently still using the deprecated interfaces
and suppressing the warning.
Ben Darnell [Sat, 21 Apr 2018 20:46:49 +0000 (16:46 -0400)]
http1connection: Un-deprecate set_close_callback
This method is not actually redundant with
HTTPMessageDelegate.on_connection_close (maybe there is a useful
refactoring that would make it so, but for now it's still useful)
Ben Darnell [Sat, 31 Mar 2018 22:01:57 +0000 (18:01 -0400)]
ioloop: Fix PeriodicCallback when system clock moves backwards
If the clock moves backwards a little bit, we could run a
PeriodicCallback twice in a row prior to this change.
Due to implementation differences between the Tornado and asyncio
event loops, this is most common when using the asyncio event loop on
windows (where in some environments differences between time.time()
and time.monotonic() can result in behavior that looks like small
backwards time jumps on every iteration), although it can in principle
occur in any environment.