Skip to content

Hangup when printing empty string to unbuffered stdout #148773

@sideeffect42

Description

@sideeffect42

Crash report

What happened?

$ sudo python3 -u -c 'print(""); print("foo")'
Hangup

When printing an empty string to unbuffered stdout, under certain circumstances (e.g. when running on AIX under sudo, screen, tmux), the user session including the Python interpreter will terminate.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Output from running 'python -VV' on the command line:

Python 3.12.13 (main, Mar 6 2026, 03:56:12) [GCC 10.3.0]

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-unsupportedinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-IOtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions