subprocess stdout read1
オープン
初心者向け
まだ誰も着手していません。
stubs: false positive
topic: io
- 主要言語
- Python
- スター
- 5.1k
- フォーク
- 2.1k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 82
説明
import subprocess
process = subprocess.Popen("echo hello", shell=True, stdout=subprocess.PIPE)
assert process.stdout is not None
print(process.stdout.read1())
mypy error:
asd.py:4: error: "IO[bytes]" has no attribute "read1"; maybe "read"?
Found 1 error in 1 file (checked 1 source file)
But at runtime there is read1() method. It is useful because unlike read(), it will return the output as soon as it is available, instead of reading more until it gets n bytes or end of file.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
subprocess.Popen の stdout スタブを見つけ、そのストリーム型がどのように宣言されているかを確認します。提供された Python スニペットで問題を再現し、その後、既存の stdout の型付けを失わずに mypy が process.stdout 上の read1() を受け入れることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 72/100