[doc] Clarify that Popen.wait is only a busy-loop in certain cases

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
58/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
documentation

調査の方向性

issueでリンクされているPopen.wait()のドキュメントから始め、ここで説明されているプラットフォームおよびtimeoutの挙動と注記を比較してください。注記を改訂し、busy-loopに関する主張をtimeout付きのPOSIX/Unixの待機に限定するとともに、timeoutなしの場合とWindowsの場合も正確に扱ってください。完了条件は、文言が技術的に正確で、asyncioに関する案内を維持していることです。

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

説明

docs

Documentation

In the docs for Popen.wait(), it states:

Note The function is implemented using a busy loop (non-blocking call and short sleeps). Use the asyncio module for an asynchronous wait: see asyncio.create_subprocess_exec.

This is actually only true in a specific circumstance: when both using Posix/Unix and a timeout is given. If, on the other hand, no timeout is given, then it does not go into a busy-loop but instead blocks on os.waitpid(). And for Windows, it never goes into a busy-loop, as it uses the WaitForSingleObject() windows API.

This note in the docs caused me to refactor my code to use asyncio - only later did I actually check what python did internally and discovered the note was wrong.

主要言語
Python
スター
77.2k
フォーク
36k
平均マージ
1日 9時間
マージ済み PR(30日)
558

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

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

はじめの一歩

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

python/cpython のほかの issue

python/cpython の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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