Error calling BaseHTTPRequestHandler.end_headers()
オープン
まだ誰も着手していません。
stdlib
type-bug
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
If a call is made to BaseHTTPRequestHandler.end_headers() but no headers or response have been queued, an exception is raised exposing implementation details.
class request_handler(BaseHTTPRequestHandler):
def do_GET(self):
self.end_headers()
Actual result
AttributeError("'request_handler' object has no attribute '_headers_buffer'")
Expected result:
pass
flush_headers has a guard to check if the buffer has been allocated which is missing from end_headers
if hasattr(self, '_headers_buffer'):
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
- gh-131718
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず CPython の BaseHTTPRequestHandler.end_headers() を見つけ、flush_headers() での処理と比較します。特に、報告で説明されている _headers_buffer のガードを確認してください。キューに入れられたヘッダーも response もない状態で end_headers() を呼び出しても、AttributeError を発生させずに完了すれば完了です。開始前にリンク先の PR gh-131718 を確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- networking
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100