Ben Darnell [Wed, 29 Dec 2021 00:44:19 +0000 (19:44 -0500)]
netutil: Use newer ssl APIs
Pass a client/server flag to all SSL context creations. This is required
to avoid deprecations in Python 3.10. This is a behavior change for
client-side connections: certificate verification and hostname checks
are now enabled in more situations (previously, the high-level
interfaces would generally enforce these requirements but the low-level
interfaces like SSLIOStream did not).
Ben Darnell [Tue, 28 Dec 2021 20:56:33 +0000 (15:56 -0500)]
testing: Deprecate AsyncTestCase
The interfaces defined by this class rely on an event loop being
"current" even though it is not running; this is incompatible with
the future of the asyncio module.
It's too big a task to rewrite all the tests right now, so just
swallow deprecation warnings for "no current event loop".
Ben Darnell [Tue, 28 Dec 2021 19:24:42 +0000 (14:24 -0500)]
ioloop: Deprecate setting current ioloop for python 3.10
asyncio.get_event_loop and related methods are deprecated in python
3.10, so deprecate some IOLoop functionality to match. Specifically,
make_current, clear_current, and the IOLoop constructor are deprecated
in favor of initializing the asyncio event loop and calling
IOLoop.current(). (The IOLoop constructor is not deprecated if
make_current=False is used. This is useful in test frameworks but is
not expected to see general use).
Ben Darnell [Fri, 3 Dec 2021 18:07:30 +0000 (13:07 -0500)]
asyncio: Deprecate AnyThreadEventLoopPolicy
Implicit creation of event loops has been deprecated in Python 3.10.
Since AnyThreadEventLoopPolicy modifies the rules for implicit loop
creation, it is also deprecated.
Ben Darnell [Fri, 31 Dec 2021 20:26:28 +0000 (15:26 -0500)]
ci: move CI to github actions
Our previous CI on Travis has been broken for a while due to their
move from travis-ci.org to travis-ci.com. Instead of fixing things up
there, move everything to github actions.
laggardkernel [Wed, 8 Dec 2021 10:55:18 +0000 (18:55 +0800)]
Remove obsolete param 'streaming' in BaseIOStream._finish_read()
Parameter 'streaming' has been obsolete since a55c7fe7 in 2018-07
when `_run_read_callback()` was renamed to `_finish_read()`.
This param should be removed as well after the removal of callback
in IOStream.
Jonas Ehrlich [Sun, 5 Sep 2021 19:31:15 +0000 (21:31 +0200)]
Add __wrapped__ attribute to _TestMethodWrapper
Since Python 3.2 the functools.wraps decorator adds a __wrapped__ attribute
pointing to the original callable, this allows wrapped functions to be introspected.
Fix case-sensitivity for Content-Encoding: gzip. as per rfc7231 the Content-Encoding values are case-insensitive https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.2.1
Alex Vandiver [Wed, 7 Apr 2021 20:11:15 +0000 (13:11 -0700)]
is_valid_ip: Do not raise exceptions on too-long input.
is_valid_ip calls `socket.getaddrinfo` with `socket.AI_NUMERICHOST` on
the potential "ip"; even though IP addresses are not hostnames and do
not use the `idna` encoding, `socket.getaddrinfo` will raise
UnicodeError if the potential "ip" is longer than 63 characters long,
the RFC-mandated max hostname length.
Catch these UnicodeErrors and return false for too-long IPs, rather
than raising an exception.
When used with asyncio.Future, WaitIterator may skip indices in some
cases. This is caused by multiple _return_result calls after another,
without having the chain_future call finish in between. This is fixed
here by not hanging on to the _running_future anymore, which forces
subsequent _return_result calls to add to _finished, instead of causing
the previous result to be silently dropped.
Florian Best [Thu, 19 Nov 2020 09:45:28 +0000 (10:45 +0100)]
Issue #2954: prevent logging error messages for not existing translation files
Every not existing translation file for the existing locales logged an error message:
Cannot load translation for 'ps': [Errno 2] No such file or directory: '/usr/share/locale/ps/LC_MESSAGES/foo.mo'
Ben Darnell [Mon, 2 Nov 2020 02:27:27 +0000 (21:27 -0500)]
platform: Deprecate twisted and cares resolvers
These were most interesting when the default resolver blocked
the main thread. Now that the default is to use a thread pool,
there is little if any demand for alternative resolvers just to
avoid threads.
Ben Darnell [Sun, 1 Nov 2020 21:08:30 +0000 (16:08 -0500)]
docs: Upgrade to latest version of sphinx
This version attempts to resolve types found in type annotations,
but in many cases it can't find them so silence a bunch of warnings.
(Looks like deferred annotation processing will make this better but
we won't be able to use that until we drop Python 3.6)
Ben Darnell [Sat, 31 Oct 2020 16:15:23 +0000 (12:15 -0400)]
maint: Prune requirements lists
Remove dependencies that are rarely used outside of tox. The main
motivation is to give dependabot less to worry about when an indirect
dependency has a security vulnerability.