`KeyError` hides the exception raised by str(key)
オープン
まだ誰も着手していません。
interpreter-core
type-bug
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
>>>a = object.__new__(type(exit))
>>>b = {}
>>>b[a]
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
b[a]
~^^^
KeyError: <exception str() failed>
The exception AttributeError was hidden:
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
b[a]
~^^^
AttributeError: 'Quitter' object has no attribute 'name'
The exception in str() shouldn't be ignore. May because of the lack of the attribute or the wrong type that __str__ return.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
- gh-139961
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、CPython 3.13 で報告にある b[a] の例を再現し、KeyError メッセージがどのように str(key) を呼び出すかを調べてください。現在の方向性については、リンク先の PR gh-139961 を確認してください。完了とは、キーのフォーマット中に発生した例外が KeyError の表示によって隠されず、そのまま保持されることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100