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

Documentation for subprocess.STDOUT needs clarification #74673

Closed
pkch mannequin opened this issue May 26, 2017 · 1 comment
Closed

Documentation for subprocess.STDOUT needs clarification #74673

pkch mannequin opened this issue May 26, 2017 · 1 comment
Labels
3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@pkch
Copy link
Mannequin

pkch mannequin commented May 26, 2017

BPO 30488
Nosy @pkch
Superseder
  • bpo-22274: subprocess.Popen(stderr=STDOUT) fails to redirect subprocess stderr to stdout
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-05-26.18:33:14.045>
    created_at = <Date 2017-05-26.17:42:41.293>
    labels = ['interpreter-core', 'type-bug', '3.7']
    title = 'Documentation for subprocess.STDOUT needs clarification'
    updated_at = <Date 2017-05-26.18:33:14.044>
    user = 'https://github.com/pkch'

    bugs.python.org fields:

    activity = <Date 2017-05-26.18:33:14.044>
    actor = 'eryksun'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-05-26.18:33:14.045>
    closer = 'eryksun'
    components = ['Interpreter Core']
    creation = <Date 2017-05-26.17:42:41.293>
    creator = 'max'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30488
    keywords = []
    message_count = 1.0
    messages = ['294560']
    nosy_count = 1.0
    nosy_names = ['max']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '22274'
    type = 'behavior'
    url = 'https://bugs.python.org/issue30488'
    versions = ['Python 2.7', 'Python 3.3', 'Python 3.4', 'Python 3.5', 'Python 3.6', 'Python 3.7']

    @pkch
    Copy link
    Mannequin Author

    pkch mannequin commented May 26, 2017

    The documentation states that subprocess.STDOUT is:

    Special value that can be used as the stderr argument to Popen and indicates that standard error should go into the same handle as standard output.

    However, when Popen is called with stdout=None, stderr=subprocess.STDOUT, stderr is not redirected to stdout and continues to be sent to stderr.

    To reproduce the problem:

    $ python >/dev/null -c 'import subprocess;\
                            subprocess.call(["ls", "/404"],stderr=subprocess.STDOUT)'

    and observe the error message appearing on the console (assuming /404 directory does not exist).

    This was reported on SO 5 years ago: https://stackoverflow.com/questions/11495783/redirect-subprocess-stderr-to-stdout.

    The SO attributed this to a documentation issue, but arguably it should be considered a bug because there seems to be no reason to make subprocess.STDOUT unusable in this very common use case.

    @pkch pkch mannequin added 3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels May 26, 2017
    @eryksun eryksun closed this as completed May 26, 2017
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant