Commit Graph

56 Commits

Author SHA1 Message Date
Oleh Prypin
b2f68ec2fe Use MaybeNone (alias to Any) when applicable (#12855) 2024-10-18 14:07:52 -07:00
Max Muoto
eaeb56ffcf Add missing winapi constants for 3.13 (#12657) 2024-09-14 11:39:22 +02:00
Max Muoto
9a77f6006d Use Final for undocumented constants (#12450) 2024-07-28 12:02:06 +02:00
Max Muoto
b7d536f910 Add missing encoding arg to check_call and call to match POpen (#12086) 2024-06-23 09:36:29 +02:00
Shantanu
d9cf43c4c3 Mark pos-only __class_getitem__ args (#11970) 2024-05-18 23:27:51 +02:00
Takumasa N
f11eb92bf4 subprocess: Use _CMD instead of str | bytes in getstatusoutput and getoutput (#11354) 2024-02-05 05:36:55 -08:00
Alex Waygood
c49c84f319 A new shade of Black (#11362) 2024-02-04 16:38:55 -08:00
Sebastian Rittau
53a8193d64 Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2024-01-05 08:15:19 -08:00
Sebastian Rittau
23604858a6 Remove Python 3.7 branches (#11238) 2024-01-05 11:39:39 +01:00
Alex Waygood
83964a4dc5 stdlib: add many missing __del__ methods (#11042) 2023-11-18 11:32:12 -08:00
Alex Waygood
516f665505 Bump flake8-pyi to 23.11.0 (#10997) 2023-11-08 16:01:24 +00:00
Alex Waygood
54d825af59 Fix Windows-specific allowlist entries in _msi, msilib, selectors and subprocess (#10822) 2023-10-02 13:01:47 +02:00
Alex Waygood
dd2818a41d Stdlib: add container default values (#9909) 2023-03-21 09:12:34 +01:00
Alex Waygood
fbc092b4cd Stdlib: add defaults for several functions that delegate kwargs to other functions at runtime (#9791) 2023-02-21 23:31:25 -08:00
Alex Waygood
9ed39d8796 Use typing_extensions.Self in the stdlib (#9694) 2023-02-09 09:12:13 +00:00
Alex Waygood
32c575d980 subprocess.check_call: executable defaults to None (#9689)
This argument is forwarded on to `Popen.__init__`, like most of the other arguments. It can be `None`, just like the `executable` parameter for all the other `subprocess` functions:

```pycon
>>> import subprocess
>>> subprocess.check_call(["python", "-c", "1/1"], executable=None)
0
>>> subprocess.check_call(["python", "-c", "1/0"], executable=None)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\alexw\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python', '-c', '1/0']' returned non-zero exit status 1.
```
2023-02-07 12:33:12 +00:00
Alex Waygood
53747b264e Stdlib: add 'obvious' default values (#9688) 2023-02-07 13:00:40 +01:00
Alex Waygood
33a62ae42d Add more defaults to the stdlib (#9606)
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
2023-01-29 01:51:23 +00:00
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Jelle Zijlstra
b9eab637cb subprocess: Improve bytes-related types (#9100) 2023-01-11 20:10:26 -08:00
Jelle Zijlstra
1ce1c1ad17 subprocess: universal_newlines may be None (#9509)
All the way back to 3.7:
https://github.com/python/cpython/blob/3.7/Lib/subprocess.py#L684

It's treated like False
2023-01-11 19:15:40 -08:00
Avasam
23ac9bff19 Check for unused pyright: ignore and differentiate from mypy ignores (#9397) 2022-12-28 10:44:29 +00:00
Коренберг Марк
bff43b53e5 Update asyncio subprocess optional **kwargs (#9177) 2022-12-18 09:51:31 -08:00
Shantanu
33e1a34e3c subprocess: use narrower types for TimeoutExpired.std* (#8886)
See https://github.com/python/cpython/pull/97685

The union type should be acceptable given https://github.com/python/cpython/issues/87597#issuecomment-1207402415. In general I'd like us to be able to type this, since these being bytes can be surprising if you pass text=True, but we'll see what mypy_primer says
2022-10-11 21:20:44 -07:00
Sebastian Rittau
faae950ade Use error codes for type ignores (#8280)
Disable reportSelfClsParameterName for pytype as this is out of typeshed's
control

Closes: #7497
2022-07-12 20:15:49 +02:00
Alex Waygood
27db37240a Remove files that only exist on <=3.6, update a few comments (#8273) 2022-07-12 09:12:32 +02:00
Alex Waygood
edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood
f69f711d5a subprocess.Popen: __new__ -> __init__ (#8203) 2022-06-28 20:11:03 +02:00
Alex Waygood
67f377898b Add process_group argument to subprocess.{run, call, check_call, check_output} (#8125) 2022-06-21 07:44:20 -07:00
Alex Waygood
a01e0260b3 Add pipesize argument to subprocess.{run, call, check_call, check_output} (#8124) 2022-06-21 05:59:26 -07:00
Alex Waygood
f9e24680c3 Add new-in-3.9 parameters to subprocess.{run, call, check_call, check_output} (#8071) 2022-06-21 04:35:50 -07:00
Alex Waygood
6b0c8df9ec Upgrade pyright, improve pyright config files (#8072) 2022-06-16 18:50:50 +01:00
Alex Waygood
60c2733ca8 subprocess.(check_)call: add text argument new in 3.7 (#8070) 2022-06-14 01:54:16 +01:00
Alex Waygood
591593c85f Simplify __all__ for modules beginning with 'm' to 't' (#8028) 2022-06-07 20:14:15 +01:00
Jelle Zijlstra
8b58371278 subprocess: new params in 3.11 (#7907) 2022-05-21 16:07:50 +01:00
Mix
32f474d6ef subprocess: improve Popen.returncode type (#7806) 2022-05-08 16:53:44 -07:00
Jelle Zijlstra
6b5068b11d Add new arguments to subprocess.Popen (#7798) 2022-05-07 09:49:23 +03:00
Jelle Zijlstra
08ae9f324b subprocess: Add _USE_VFORK and _USE_POSIX_SPAWN (#7687)
These are now documented: python/cpython#91490
2022-04-25 21:13:39 -06:00
Alex Waygood
97a74bc1aa Import from collections.abc wherever possible (#7635) 2022-04-18 12:50:37 +02:00
Alex Waygood
740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Alex Waygood
f4ae363b56 stdlib: correct many pos-or-kw arg names in dunder methods (#7451) 2022-03-07 16:40:03 +01:00
Alex Waygood
95885c96ed Add subprocess.__all__ (#7390) 2022-02-27 16:01:51 -08:00
Shantanu
b88a6f19cd Upgrade black version (#7089) 2022-01-30 16:27:06 -08:00
Nikita Sobolev
67766f282f Use import instead of re-definition of constants in subprocess (#7065) 2022-01-28 00:09:33 -08:00
Alex Waygood
a40d79a4e6 Use lowercase type everywhere (#6853) 2022-01-08 16:09:29 +01:00
ROHAN SALWAN
766f7e76ec Fix subprocess.list2cmdline: wrong type of the seq argument (#6190) 2021-10-25 12:06:55 +03:00
Akuli
994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
Akuli
ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Rebecca Chen
8da23e0634 Broaden the signature of subprocess.list2cmdline. (#5824)
Although the parameter is called 'seq', the implementation shows that it
can be anything that can be passed to map(), which takes iterables:
0f42b726c8/Lib/subprocess.py (L565).
2021-07-30 12:15:27 -07:00