asyncio.subprocess: duplicate _shell args to _exec
Fixes: 38dfb57adf
Expanding the keywords used True arguments for shell in both _exec and _shell. The _exec one is for shell=False. With the text argument, its the other way around: both demand Falsy here, so match those lines.
The _warn parameter to these methods is just there to work around
some finalization issues and should never be used by users. In
addition, these protocols are out of date (the "stacklevel" argument
is not used by current CPython main). I don't think we gain anything
by trying to maintain these protocol definitions.
And fix the return value of return value of `IocpProactor.recvfrom_into()`, which was incorrect
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Continuing work towards #8988.
The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:
- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
Since python 3.7, asyncio.loop.create_datagram_endpoint expects the
arguments `local_addr` and `remote_addr` to be `str` or `None` when the
argument family=`socket.AF_UNIX` and the argument `sock` is `None` or
also a unix socket.
- Change the return type of create_connection, start_tls,
connect_accepted_socket, create_unix_connection to Transport
rather than BaseTransport (closes#9199).
- Change the return type of create_datagram_endpoint to
DatagramTransport rather than BaseTransport.
- Change the argument of sendfile to WriteTransport rather than
BaseTransport.
I considered also changing the argument of start_tls to Transport, but
I think that will give false positives for code that implements a custom
transport class that inherits from both ReadTransport and WriteTransport
but not from Transport, and I'm not sure if typing has a way to express
an intersection of types. Since users are not normally expected to
implement transports that may be overthinking things.