Skip to content

python -m asyncio returns 0 when failing with ENOTTY in the runner thread #121711

Closed
@zvyn

Description

@zvyn

Bug report

Bug description:

The return code at the end here is 0 when it should be 25 aka ENOTTY:

import subprocess
proc = subprocess.Popen(["./python", "-m", "asyncio"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
with proc:
    try:
        out, err = proc.communicate()
    finally:
        proc.kill()
proc.returncode

note: I tested this with --disable-gil configured

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-asynciotopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions