mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Add new arguments to subprocess.Popen (#7798)
This commit is contained in:
@@ -804,7 +804,556 @@ class Popen(Generic[AnyStr]):
|
||||
# Technically it is wrong that Popen provides __new__ instead of __init__
|
||||
# but this shouldn't come up hopefully?
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
if sys.version_info >= (3, 11):
|
||||
# process_group is added in 3.11
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: bool | None = ...,
|
||||
encoding: str,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
process_group: int | None = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
process_group: int | None = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
*,
|
||||
universal_newlines: Literal[True],
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
# where the *real* keyword only args start
|
||||
text: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
process_group: int | None = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: Literal[True],
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
process_group: int | None = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: Literal[None, False] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
process_group: int | None = ...,
|
||||
) -> Popen[bytes]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
process_group: int | None = ...,
|
||||
) -> Popen[Any]: ...
|
||||
elif sys.version_info >= (3, 10):
|
||||
# pipesize is added in 3.10
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: bool | None = ...,
|
||||
encoding: str,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
*,
|
||||
universal_newlines: Literal[True],
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
# where the *real* keyword only args start
|
||||
text: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: Literal[True],
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: Literal[None, False] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Popen[bytes]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
pipesize: int = ...,
|
||||
) -> Popen[Any]: ...
|
||||
elif sys.version_info >= (3, 9):
|
||||
# user, group, extra_groups, umask were added in 3.9
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: bool | None = ...,
|
||||
encoding: str,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
*,
|
||||
universal_newlines: Literal[True],
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
# where the *real* keyword only args start
|
||||
text: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: Literal[True],
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
) -> Popen[str]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: Literal[None, False] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
) -> Popen[bytes]: ...
|
||||
@overload
|
||||
def __new__(
|
||||
cls,
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
text: bool | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
user: str | int | None = ...,
|
||||
group: str | int | None = ...,
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
) -> Popen[Any]: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
# text is added in 3.7
|
||||
@overload
|
||||
def __new__(
|
||||
|
||||
Reference in New Issue
Block a user