Title: Error calling BaseHTTPRequestHandler.end_headers() · Issue #131715 · python/cpython · GitHub
Open Graph Title: Error calling BaseHTTPRequestHandler.end_headers() · Issue #131715 · python/cpython
X Title: Error calling BaseHTTPRequestHandler.end_headers() · Issue #131715 · python/cpython
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...
Open Graph 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 requ...
X 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 requ...
Opengraph URL: https://github.com/python/cpython/issues/131715
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error calling BaseHTTPRequestHandler.end_headers()","articleBody":"# Bug report\n\n### Bug description:\n\nIf a call is made to `BaseHTTPRequestHandler.end_headers()` but no headers or response have been queued, an exception is raised exposing implementation details.\n\n```python\n class request_handler(BaseHTTPRequestHandler):\n def do_GET(self):\n self.end_headers()\n```\n\nActual result\n```\nAttributeError(\"'request_handler' object has no attribute '_headers_buffer'\")\n```\n\nExpected result:\n```\npass\n```\n\n`flush_headers` has a guard to check if the buffer has been allocated which is missing from `end_headers`\n```\nif hasattr(self, '_headers_buffer'):\n```\n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-131718\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/jnewbigin","@type":"Person","name":"jnewbigin"},"datePublished":"2025-03-25T13:03:28Z","url":"https://github.com/python/cpython/issues/131715"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b8f24a45-1422-1a07-e02c-16c717bc0996 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84E0:62F48:E497F9:12DD235:6B0203B0 |
| html-safe-nonce | 95040c9ceb3fa727d43cff1449375287f0fc0c205a9eff88941646e90be14c06 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEUwOjYyRjQ4OkU0OTdGOToxMkREMjM1OjZCMDIwM0IwIiwidmlzaXRvcl9pZCI6IjkwMTk3ODQ4MDc3OTM2ODk1MjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6a9312dc80a9db16b513d09508a949af836f0607fc10174716c52c79a4ec5185 |
| hovercard-subject-tag | issue:2946470611 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/131715/issue_layout |
| twitter:image | https://opengraph.githubassets.com/773488dec0510acc469f5600450a7a1a08b012c8e9f0a32171421de961bbd6d5/python/cpython/issues/131715 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/773488dec0510acc469f5600450a7a1a08b012c8e9f0a32171421de961bbd6d5/python/cpython/issues/131715 |
| og:image:alt | 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 requ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jnewbigin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width