René's URL Explorer Experiment


Title: Regression: ImportError for `HeaderWriteError` in long-running process post-Python update for CVE-2024-6923 · Issue #124170 · python/cpython · GitHub

Open Graph Title: Regression: ImportError for `HeaderWriteError` in long-running process post-Python update for CVE-2024-6923 · Issue #124170 · python/cpython

X Title: Regression: ImportError for `HeaderWriteError` in long-running process post-Python update for CVE-2024-6923 · Issue #124170 · python/cpython

Description: Bug report Bug description: Pull request #122233 introduced a new class HeaderWriteError in commit 0976339 and imports that from email.generator. This breaks running applications that have imported other parts of email before the update,...

Open Graph Description: Bug report Bug description: Pull request #122233 introduced a new class HeaderWriteError in commit 0976339 and imports that from email.generator. This breaks running applications that have imported...

X Description: Bug report Bug description: Pull request #122233 introduced a new class HeaderWriteError in commit 0976339 and imports that from email.generator. This breaks running applications that have imported...

Opengraph URL: https://github.com/python/cpython/issues/124170

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression: ImportError for `HeaderWriteError` in long-running process post-Python update for  CVE-2024-6923","articleBody":"# Bug report\n\n### Bug description:\n\nPull request #122233 introduced a new class `HeaderWriteError` in commit 097633981879b3c9de9a1dd120d3aa585ecc2384 and imports that from `email.generator`.\n\nThis breaks running applications that have imported other parts of `email` before the update, and then try to import the generator past the update.\n\nNow this is a bit silly, but it is what `email.message.Message.as_string()` does, it imports `email.generator` *inside* the function - which may happen at any point of the program run-time rather than at startup.\n\nFor example, the following pseudo-code will fail, assuming it has not generated another email earlier or manually imported the `email.generator` module.\n\n```python\nimport email.message\n\u003cdo something for a long time, such as wait for a web form, Python is being upgraded here>\nmsg = \u003cprepare a message>\nmsg.as_string()\n```\n\nA particular instance of the issue is the `unattended-upgrades` package in Ubuntu and Debian, which will install the security update and then may send an email and fail there due to the ImportError, see https://bugs.launchpad.net/ubuntu/+source/python3.8/+bug/2080940.\n\nI'm wondering if it's feasible to add a workaround to the stable branches:\n\nCchange the email.generator module import:\n\n```python\nfrom email.errors import HeaderWriteError\n```\n\nto graciously support the previous version email.errors:\n\n```python\ntry:\n    from email.errors import HeaderWriteError\nexcept ImportError:\n    from email.errors import MessageError as HeaderWriteError\n```\n\nThis is a safe change, existing applications, where the import fails can't be having `except HeaderWriteError` statements anyway.\n\nThanks.\n\n### CPython versions tested on:\n\n3.12\n\n### Operating systems tested on:\n\n_No response_","author":{"url":"https://github.com/julian-klode","@type":"Person","name":"julian-klode"},"datePublished":"2024-09-17T12:02:59Z","url":"https://github.com/python/cpython/issues/124170"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f7a8f70a-6093-9e52-c755-b70a7130b363
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE200:C93D7:2B5C2F:3CBEA2:6B005C64
html-safe-nonce1d1301079423e98e17afa1c65f2945141f5fe6b76f0441cae74d5674eacc2b0a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjAwOkM5M0Q3OjJCNUMyRjozQ0JFQTI6NkIwMDVDNjQiLCJ2aXNpdG9yX2lkIjoiNDg1NzIwNTg5NzI1ODA5Nzc2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0f5322b838a52570e6b4860554812e20ad449e29623d1bf6521aa344c011a308
hovercard-subject-tagissue:2530973376
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/124170/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1ee36c56aed7ff85d389964337a06e72685202c66060d37d5818ca89badb2f2d/python/cpython/issues/124170
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1ee36c56aed7ff85d389964337a06e72685202c66060d37d5818ca89badb2f2d/python/cpython/issues/124170
og:image:altBug report Bug description: Pull request #122233 introduced a new class HeaderWriteError in commit 0976339 and imports that from email.generator. This breaks running applications that have imported...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejulian-klode
hostnamegithub.com
expected-hostnamegithub.com
None29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseeacd927ba6112e3b01ba99c762bd699a4a4f5df7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/124170#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F124170
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F124170
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/124170
Reloadhttps://github.com/python/cpython/issues/124170
Reloadhttps://github.com/python/cpython/issues/124170
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/124170
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/124170
Regression: ImportError for HeaderWriteError in long-running process post-Python update for CVE-2024-6923https://github.com/python/cpython/issues/124170#top
topic-emailhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-email%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/julian-klode
julian-klodehttps://github.com/julian-klode
on Sep 17, 2024https://github.com/python/cpython/issues/124170#issue-2530973376
#122233https://github.com/python/cpython/pull/122233
0976339https://github.com/python/cpython/commit/097633981879b3c9de9a1dd120d3aa585ecc2384
https://bugs.launchpad.net/ubuntu/+source/python3.8/+bug/2080940https://bugs.launchpad.net/ubuntu/+source/python3.8/+bug/2080940
julian-klodehttps://github.com/julian-klode
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Sep 17, 2024https://github.com/python/cpython/issues/124170#event-14290182244
https://github.com/julian-klode
julian-klodehttps://github.com/julian-klode
on Sep 17, 2024https://github.com/python/cpython/issues/124170#issuecomment-2355530027
terryjreedyhttps://github.com/terryjreedy
topic-emailhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-email%22
on Sep 17, 2024https://github.com/python/cpython/issues/124170#event-14294292993
https://github.com/jimkoeleman
jimkoelemanhttps://github.com/jimkoeleman
on Sep 18, 2024https://github.com/python/cpython/issues/124170#issuecomment-2358327414
https://github.com/muzomer
muzomerhttps://github.com/muzomer
on Sep 18, 2024https://github.com/python/cpython/issues/124170#issuecomment-2358347669
django/django@bf4888dhttps://github.com/django/django/commit/bf4888d317ba4506d091eeac6e8b4f1fcc731199
https://github.com/jimkoeleman
jimkoelemanhttps://github.com/jimkoeleman
on Sep 18, 2024https://github.com/python/cpython/issues/124170#issuecomment-2358525419
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Sep 18, 2024https://github.com/python/cpython/issues/124170#issuecomment-2358619088
https://github.com/jimkoeleman
jimkoelemanhttps://github.com/jimkoeleman
on Sep 18, 2024https://github.com/python/cpython/issues/124170#issuecomment-2358945774
https://github.com/DanielRuf
DanielRufhttps://github.com/DanielRuf
on Sep 23, 2024https://github.com/python/cpython/issues/124170#issuecomment-2367431110
https://github.com/frewper
frewperhttps://github.com/frewper
on Oct 22, 2024https://github.com/python/cpython/issues/124170#issuecomment-2428274567
mvo5https://github.com/mvo5
on Nov 10, 2024https://github.com/python/cpython/issues/124170#event-15240442142
u-u: reload the "email.errors" package to workaround (LP: 2080940)https://github.com/mvo5/unattended-upgrades/commit/d95158a8874a3e6f10189b48ba59fe10df6c9157
d95158ahttps://github.com/mvo5/unattended-upgrades/commit/d95158a8874a3e6f10189b48ba59fe10df6c9157
u-u: reload the "email.errors" package to workaround (LP: 2080940)https://github.com/mvo5/unattended-upgrades/commit/2c565f85b6fb71328f20f8f931dd65c3424cb55d
2c565f8https://github.com/mvo5/unattended-upgrades/commit/2c565f85b6fb71328f20f8f931dd65c3424cb55d
u-u: reload the "email.errors" package to workaround (LP: 2080940)https://github.com/mvo5/unattended-upgrades/commit/613d2fcdfa315e815893eea72d3ecb1d65809b9f
613d2fchttps://github.com/mvo5/unattended-upgrades/commit/613d2fcdfa315e815893eea72d3ecb1d65809b9f
u-u: import "email" package late to workaround (LP: 2080940)https://github.com/mvo5/unattended-upgrades/commit/c8f846dc1e8e4bfbb927216b9aa528b72cd906eb
c8f846dhttps://github.com/mvo5/unattended-upgrades/commit/c8f846dc1e8e4bfbb927216b9aa528b72cd906eb
u-u: import "email" package late to workaround (LP: 2080940)https://github.com/mvo5/unattended-upgrades/commit/9fa4d2927d58f5a91e6437f4295df7124862f647
9fa4d29https://github.com/mvo5/unattended-upgrades/commit/9fa4d2927d58f5a91e6437f4295df7124862f647
u-u: import "email.genators" package early to workaroundhttps://github.com/mvo5/unattended-upgrades/commit/b2a85abf0c8a3b0ccb56c7ec209c50b8d2d5971a
b2a85abhttps://github.com/mvo5/unattended-upgrades/commit/b2a85abf0c8a3b0ccb56c7ec209c50b8d2d5971a
u-u: import "email.genators" package early as workaroundhttps://github.com/mvo5/unattended-upgrades/commit/b908b1706964a9958f8d670e5186a8e9059ff07c
b908b17https://github.com/mvo5/unattended-upgrades/commit/b908b1706964a9958f8d670e5186a8e9059ff07c
u-u: import "email.genators" package early as workaroundhttps://github.com/mvo5/unattended-upgrades/commit/ca9c9e0158e5bd57f6a56a72bd3380a5ad71d741
ca9c9e0https://github.com/mvo5/unattended-upgrades/commit/ca9c9e0158e5bd57f6a56a72bd3380a5ad71d741
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/124170
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/124170
topic-emailhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-email%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.