python / python/cpython

Hangup when printing empty string to unbuffered stdout

オープン
#148,773 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

interpreter-core OS-unsupported topic-IO type-bug
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

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
  • gh-148774

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、バッファリングされていない stdout を使って報告されたコマンドを再現し、issue に記載されている AIX、sudo、screen、tmux の状況に焦点を当てます。リンクされている PR gh-148774 と、それが示している CPython の関連する stdout/write パスを確認します。コマンドによってユーザーセッションが終了しなくなり、その動作が適切な回帰テストでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。