Improve wave module error messages to include the offending value
オープン
まだ誰も着手していません。
stdlib
type-feature
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Summary
The wave module currently raises errors without the offending value:
wave.Error: bad # of channels
wave.Error: bad sample width
wave.Error: bad frame rate
When values come from variables, configuration, or parsed data, the
traceback shows the call site but not the actual offending value. For
Wave_read, the values are parsed from the WAV file header and never
appear in the traceback at all.
Reproduction
import wave, io
wave.open(io.BytesIO(), 'wb').setframerate(-1)
# wave.Error: bad frame rate
After this change:
wave.Error: bad frame rate: -1
I have a patch ready and will open a PR shortly.
Linked PRs
- gh-149307
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
wave モジュールの検証パスから始め、setframerate(-1) と、issue で言及されている Wave_read のヘッダー解析を含めます。現在のエラーを再現し、その後、関連する各メッセージに問題の値が含まれていること、および既存の wave の動作が維持されていることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- audio-video-rtc
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 25/100