`logging.shutdown()` should clear `logging._handlerList` if that's what it's called with
まだ誰も着手していません。
- #129681 @cjw296 による — マージされずにクローズ
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
In the wild, I've encountered situations where logging.shutdown gets called more than once in a process.
The current implementation is called with logging._handlerList by default, meaning that handlers can have their flush() and close() methods called more than once, which can cause bad things to happen if those handlers are not amenable to being closed more than once.
If logging.shutdown() is processing logging._handlerList, it should clear that list once it finished to prevent handlers having their flush() and close() methods called more than once.
CPython versions tested on:
3.12, CPython main branch
Operating systems tested on:
Linux, macOS
Linked PRs
- gh-129681
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
logging.shutdown() のエントリーポイントから始め、logging._handlerList がどのように処理されるかを調べます。これには、報告で説明されている flush() と close() の繰り返し呼び出しも含まれます。shutdown が処理後にデフォルトのハンドラーリストをクリアすることを確認し、shutdown を繰り返し呼び出しても同じハンドラーが再度処理されないことを検証します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100