Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout unit isn't specified in subprocess docstrings #128342

Closed
n-l-i opened this issue Dec 30, 2024 · 1 comment
Closed

Timeout unit isn't specified in subprocess docstrings #128342

n-l-i opened this issue Dec 30, 2024 · 1 comment
Labels
docs Documentation in the Doc dir

Comments

@n-l-i
Copy link
Contributor

n-l-i commented Dec 30, 2024

Documentation

Timeout unit isn't specified in subprocess docstrings. For example here:

def run(*popenargs,
        input=None, capture_output=False, timeout=None, check=False, **kwargs):
    """Run command with arguments and return a CompletedProcess instance.

    The returned instance will have attributes args, returncode, stdout and
    stderr. By default, stdout and stderr are not captured, and those attributes
    will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
    or pass capture_output=True to capture both.

    If check is True and the exit code was non-zero, it raises a
    CalledProcessError. The CalledProcessError object will have the return code
    in the returncode attribute, and output & stderr attributes if those streams
    were captured.

    If timeout is given, and the process takes too long, a TimeoutExpired
    exception will be raised.

    There is an optional argument "input", allowing you to
    pass bytes or a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it will be used internally.

    By default, all communication is in bytes, and therefore any "input" should
    be bytes, and the stdout and stderr will be bytes. If in text mode, any
    "input" should be a string, and stdout and stderr will be strings decoded
    according to locale encoding, or by "encoding" if set. Text mode is
    triggered by setting any of text, encoding, errors or universal_newlines.

    The other arguments are the same as for the Popen constructor.
    """

It would be nice if it specified the unit of the timeout.

Linked PRs

@n-l-i n-l-i added the docs Documentation in the Doc dir label Dec 30, 2024
gpshead pushed a commit that referenced this issue Dec 30, 2024
Specify timeout unit (seconds) in subprocess docstrings

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 30, 2024
…nGH-128343)

Specify timeout unit (seconds) in subprocess docstrings
(cherry picked from commit dafe7a4)

Co-authored-by: n-l-i <57808975+n-l-i@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 30, 2024
…nGH-128343)

Specify timeout unit (seconds) in subprocess docstrings
(cherry picked from commit dafe7a4)

Co-authored-by: n-l-i <57808975+n-l-i@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gpshead pushed a commit that referenced this issue Dec 30, 2024
…28343) (#128366)

gh-128342: Specify timeout unit in subprocess docstrings (GH-128343)

Specify timeout unit (seconds) in subprocess docstrings
(cherry picked from commit dafe7a4)

Co-authored-by: n-l-i <57808975+n-l-i@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
@gpshead gpshead moved this from Todo to Done in docs issues Dec 30, 2024
@gpshead
Copy link
Member

gpshead commented Dec 30, 2024

thanks!

@gpshead gpshead closed this as completed Dec 30, 2024
gpshead pushed a commit that referenced this issue Dec 30, 2024
…28343) (#128365)

gh-128342: Specify timeout unit in subprocess docstrings (GH-128343)

Specify timeout unit (seconds) in subprocess docstrings
(cherry picked from commit dafe7a4)

Co-authored-by: n-l-i <57808975+n-l-i@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
Status: Done
Development

No branches or pull requests

2 participants