Skip to content

errors parameter missing in subprocess.call()/subprocess.check_call() #16538

Open

Description

@zsz12251665

# Same args as Popen.__init__
if sys.version_info >= (3, 11):
# 3.11 adds "process_group" argument
def call(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], object] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
encoding: str | None = None,
timeout: float | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
pipesize: int = -1,
process_group: int | None = None,
) -> int: ...
else:
# 3.10 adds "pipesize" argument
def call(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], object] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
encoding: str | None = None,
timeout: float | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
pipesize: int = -1,
) -> int: ...
# Same args as Popen.__init__
if sys.version_info >= (3, 11):
# 3.11 adds "process_group" argument
def check_call(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], object] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
timeout: float | None = None,
*,
encoding: str | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
pipesize: int = -1,
process_group: int | None = None,
) -> int: ...
else:
# 3.10 adds "pipesize" argument
def check_call(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], object] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
timeout: float | None = None,
*,
encoding: str | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
pipesize: int = -1,
) -> int: ...

According to the Python documentation and the comments within the stub file, the functions subprocess.call() and subprocess.check_call() should share the same parameters as subprocess.Popen except timeout. However, the errors parameter found in the Popen interface is missing in subprocess.call and subprocess.check_call.

errors: str | None = None,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions