Pure Python `SimpleQueue.get()` raises `ValueError` when block is false and timeout is given
オープン
まだ誰も着手していません。
stdlib
type-bug
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
The docs for SimpleQueue.get() say that timeout is ignored when block is false. The C version does that, but the pure Python version passes timeout to threading.Semaphore.acquire() and fails:
>>> from queue import _PySimpleQueue
>>> _PySimpleQueue().get(block=False, timeout=1)
Traceback (most recent call last):
...
ValueError: can't specify timeout for non-blocking acquire
The C version raises Empty here.
A PR is on the way.
Linked PRs
- gh-156477
- gh-156487
- gh-156488
- gh-156489
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
純粋な Python による _PySimpleQueue.get() の実装から始め、block=False と timeout の扱いを C 版および SimpleQueue のドキュメントと比較してください。指定された timeout を伴う非ブロッキングの get がドキュメントに記載された動作に従い、ValueError ではなく Empty を送出すれば完了です。issue に示されている既存の動作を確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 25/100