email.utils.collapse_rfc2231_value raises AttributeError on non-3-tuples
オープン
まだ誰も着手していません。
stdlib
topic-email
type-bug
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
Issue
collapse_rfc2231_value raises AttributeError: 'tuple' object has no attribute 'startswith' when passed a tuple whose length is not 3. The guard if not isinstance(value, tuple) or len(value) != 3 is meant to handle this case, but falls through to unquote(value) which expects a string.
Reproducer
from email.utils import collapse_rfc2231_value
collapse_rfc2231_value(('a', 'b'))
# AttributeError: 'tuple' object has no attribute 'startswith'
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-145825
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
email.utils.collapse_rfc2231_value から始め、2 要素のタプルを使って issue の再現手順を実行します。長さが 3 ではないタプルをどのように扱うべきかを判断し、その後、報告された AttributeError が発生しなくなるようにリグレッションテストのカバレッジを追加または更新します。リンクされた PR gh-145825 は、その作業がすでに進行中であることを示しています。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100