-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
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
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error