Title: `AttributeError` in `email._header_value_parser.get_address` · Issue #134155 · python/cpython · GitHub
Open Graph Title: `AttributeError` in `email._header_value_parser.get_address` · Issue #134155 · python/cpython
X Title: `AttributeError` in `email._header_value_parser.get_address` · Issue #134155 · python/cpython
Description: Bug report Bug description: During fuzzing of Python standard libraries, the following code snippet causes an AttributeError with the following message: AttributeError: 'InvalidHeaderDefect' object has no attribute 'all_defects'. This oc...
Open Graph Description: Bug report Bug description: During fuzzing of Python standard libraries, the following code snippet causes an AttributeError with the following message: AttributeError: 'InvalidHeaderDefect' object...
X Description: Bug report Bug description: During fuzzing of Python standard libraries, the following code snippet causes an AttributeError with the following message: AttributeError: 'InvalidHeaderDefect'...
Opengraph URL: https://github.com/python/cpython/issues/134155
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`AttributeError` in `email._header_value_parser.get_address`","articleBody":"# Bug report\n\n### Bug description:\n\nDuring fuzzing of Python standard libraries, the following code snippet causes an `AttributeError` with the following message: `AttributeError: 'InvalidHeaderDefect' object has no attribute 'all_defects'`. This occurs in the `all_defects` function at line 140 in `email/_header_value_parser.py`.\n\n```\nimport email._header_value_parser\nemail._header_value_parser.get_address(\"!an??:=m==fr2@[C\")\n```\n\n### Exception Trace\n```\nTraceback (most recent call last):\n File \"rep.py\", line 3, in \u003cmodule>\n email._header_value_parser.get_address(\"!an??:=m==fr2@[C\")\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 1988, in get_address\n token, value = get_group(value)\n ^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 1954, in get_group\n token, value = get_group_list(value)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 1926, in get_group_list\n token, value = get_mailbox_list(value)\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 1860, in get_mailbox_list\n token, value = get_mailbox(value)\n ^^^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 1822, in get_mailbox\n for x in token.all_defects):\n ^^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 140, in all_defects\n return sum((x.all_defects for x in self), self.defects)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 140, in \u003cgenexpr>\n return sum((x.all_defects for x in self), self.defects)\n ^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 140, in all_defects\n return sum((x.all_defects for x in self), self.defects)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 140, in \u003cgenexpr>\n return sum((x.all_defects for x in self), self.defects)\n ^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 140, in all_defects\n return sum((x.all_defects for x in self), self.defects)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.12/email/_header_value_parser.py\", line 140, in \u003cgenexpr>\n return sum((x.all_defects for x in self), self.defects)\n ^^^^^^^^^^^^^\nAttributeError: 'InvalidHeaderDefect' object has no attribute 'all_defects'\n```\n\n### CPython versions tested on:\n\n3.12, 3.11, 3.10, 3.9\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-134194\n* gh-135191\n* gh-135192\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/gabe-sherman","@type":"Person","name":"gabe-sherman"},"datePublished":"2025-05-17T19:26:32Z","url":"https://github.com/python/cpython/issues/134155"}
| 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:5d0b504f-40b8-d1e0-af7b-fbeb759586df |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 93EC:158DF1:1E8DD6B:283FCCE:6B022F3E |
| html-safe-nonce | 07a31eb727e299f761c20b0414530e595adda13ba14a04a64ae7045bd3fa9d68 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0VDOjE1OERGMToxRThERDZCOjI4M0ZDQ0U6NkIwMjJGM0UiLCJ2aXNpdG9yX2lkIjoiMTI0ODExMjI2Njc0MjczODc1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 214f4f61bfb8e8f008bc75ad7d5336cbdefbaf2ce7a0c82b52a7b6b0e419b71d |
| hovercard-subject-tag | issue:3071013019 |
| 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/134155/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fe8f19124f9c91d37a65244446ec51717135924a2f5ae375a44ceffb4f131c27/python/cpython/issues/134155 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fe8f19124f9c91d37a65244446ec51717135924a2f5ae375a44ceffb4f131c27/python/cpython/issues/134155 |
| og:image:alt | Bug report Bug description: During fuzzing of Python standard libraries, the following code snippet causes an AttributeError with the following message: AttributeError: 'InvalidHeaderDefect' object... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gabe-sherman |
| 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