Error calling BaseHTTPRequestHandler.end_headers()
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando BaseHTTPRequestHandler.end_headers() di CPython e confronta la sua gestione con flush_headers(), in particolare il controllo di _headers_buffer descritto nel report. Il lavoro è completato quando la chiamata a end_headers() senza header accodati né una response termina senza esporre un AttributeError; controlla la PR collegata gh-131718 prima di iniziare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- networking
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100