René's URL Explorer Experiment


Title: Overflows happened silently in array.array setters for 'e', 'f' and 'Zf' format types · Issue #156865 · python/cpython · GitHub

Open Graph Title: Overflows happened silently in array.array setters for 'e', 'f' and 'Zf' format types · Issue #156865 · python/cpython

X Title: Overflows happened silently in array.array setters for 'e', 'f' and 'Zf' format types · Issue #156865 · python/cpython

Description: Bug report Bug description: Consider this: >>> import array >>> a = array.array('e', [123]) >>> a[0] = 123456 Traceback (most recent call last): File "", line 1, in a[0] = 123456 ~^^^ OverflowError: float too lar...

Open Graph Description: Bug report Bug description: Consider this: >>> import array >>> a = array.array('e', [123]) >>> a[0] = 123456 Traceback (most recent call last): File "", line 1, in a[0] = ...

X Description: Bug report Bug description: Consider this: >>> import array >>> a = array.array('e', [123]) >>> a[0] = 123456 Traceback (most recent call last): File "<py...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Overflows happened silently in array.array setters for 'e', 'f' and 'Zf' format types","articleBody":"# Bug report\n\n### Bug description:\n\nConsider this:\n```pycon\n>>> import array\n>>> a = array.array('e', [123])\n>>> a[0] = 123456\nTraceback (most recent call last):\n  File \"\u003cpython-input-2>\", line 1, in \u003cmodule>\n    a[0] = 123456\n    ~^^^\nOverflowError: float too large to pack with e format\n>>> a = array.array('f', [123])\n>>> a[0] = 1e70  # no OverflowError\n>>> a\narray('f', [inf])\n>>> a = array.array('Zf', [123])\n>>> a[0] = 1e70j  # no OverflowError\n>>> a\narray('Zf', [infj])\n>>> import struct\n>>> struct.pack('f', 1e70)\nTraceback (most recent call last):\n  File \"\u003cpython-input-7>\", line 1, in \u003cmodule>\n    struct.pack('f', 1e70)\n    ~~~~~~~~~~~^^^^^^^^^^^\nOverflowError: float too large to pack with f format\n>>> struct.pack('>Zf', 1e70j)\nTraceback (most recent call last):\n  File \"\u003cpython-input-13>\", line 1, in \u003cmodule>\n    struct.pack('>Zf', 1e70j)\n    ~~~~~~~~~~~^^^^^^^^^^^^^^\nOverflowError: float too large to pack with f format\n```\n(BTW, `f_setitem()` suffers from same issue as https://github.com/python/cpython/issues/156864.)\n\nMaybe it's a feature and array() should behave differently wrt the struct module.  In either case, this behavior looks inconsistent.  If we consider cases for 'f'/'Zf' types being correct - we should clear exceptions also for 'e' type code.\n\nSee also struct/array issues (merged to this per @vstinner suggestion):\n* https://github.com/python/cpython/issues/156864\n* https://github.com/python/cpython/issues/156867\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-156869\n* gh-156868\n* gh-156916\n* gh-156919\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2026-09-02T23:49:11Z","url":"https://github.com/python/cpython/issues/156865"}

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:915326d6-5090-2eb6-7903-9c99fb80360d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idABA6:2DBB21:36DEB10:492E895:6B0211E3
html-safe-nonce356ca54a0ae7d686dc91ab50d222629eb95b0e8050cebc145eb5f09f09a29950
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkE2OjJEQkIyMTozNkRFQjEwOjQ5MkU4OTU6NkIwMjExRTMiLCJ2aXNpdG9yX2lkIjoiODMwNDc0NjY5OTQ2MTYyODM4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2f8cfdc51b12c2be0d2076279593c651f51e6bd8a7df0e9d3bef734d09ae9c37
hovercard-subject-tagissue:5330471171
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/156865/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c1d708aff45459a964ebb4ddfaa749b43fcb43e931bdbb6dc33f839a19337e71/python/cpython/issues/156865
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c1d708aff45459a964ebb4ddfaa749b43fcb43e931bdbb6dc33f839a19337e71/python/cpython/issues/156865
og:image:altBug report Bug description: Consider this: >>> import array >>> a = array.array('e', [123]) >>> a[0] = 123456 Traceback (most recent call last): File "", line 1, in a[0] = ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameskirpichev
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/156865#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F156865
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%2F156865
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/156865
Reloadhttps://github.com/python/cpython/issues/156865
Reloadhttps://github.com/python/cpython/issues/156865
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/156865
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/156865
Overflows happened silently in array.array setters for 'e', 'f' and 'Zf' format typeshttps://github.com/python/cpython/issues/156865#top
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/skirpichev
skirpichevhttps://github.com/skirpichev
on Sep 2, 2026https://github.com/python/cpython/issues/156865#issue-5330471171
#156864https://github.com/python/cpython/issues/156864
@vstinnerhttps://github.com/vstinner
array.array() setter incorrectly handle overflows for 'e' type code #156864https://github.com/python/cpython/issues/156864
struct.pack() doesn't checks overflows for native 'Zf' format type #156867https://github.com/python/cpython/issues/156867
gh-156865: correctly detect overflows for array's "e", "f" and "Zf" type codes #156869https://github.com/python/cpython/pull/156869
gh-156865: struct.pack() check for overflows for Zf type #156868https://github.com/python/cpython/pull/156868
gh-156865: correctly handle float/complex overflows in memoryview #156916https://github.com/python/cpython/pull/156916
gh-156865: Don't raise exceptions for ctypes.c_float_complex overflows #156919https://github.com/python/cpython/pull/156919
skirpichevhttps://github.com/skirpichev
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Sep 2, 2026https://github.com/python/cpython/issues/156865#event-30452805557
skirpichevhttps://github.com/skirpichev
on Sep 3, 2026https://github.com/python/cpython/issues/156865#event-30453865183
aiskhttps://github.com/aisk
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
on Sep 3, 2026https://github.com/python/cpython/issues/156865#event-30456790958
https://github.com/skirpichev
skirpichevhttps://github.com/skirpichev
on Sep 3, 2026https://github.com/python/cpython/issues/156865#issuecomment-5519408795
@encukouhttps://github.com/encukou
@meadorihttps://github.com/meadori
skirpichevhttps://github.com/skirpichev
on Sep 3, 2026https://github.com/python/cpython/issues/156865#event-30460521659
https://github.com/skirpichev
skirpichevhttps://github.com/skirpichev
on Sep 3, 2026https://github.com/python/cpython/issues/156865#issuecomment-5520437382
https://github.com/maurycy
maurycyhttps://github.com/maurycy
on Sep 3, 2026https://github.com/python/cpython/issues/156865#issuecomment-5521321658
cpython/Modules/_struct.chttps://github.com/python/cpython/blob/39a9a47516abf8a68cb3239f968c2b2135c3a5a7/Modules/_struct.c#L793-L800
39a9a47https://github.com/python/cpython/commit/39a9a47516abf8a68cb3239f968c2b2135c3a5a7
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Sep 3, 2026https://github.com/python/cpython/issues/156865#issuecomment-5524604544
gh-156864https://github.com/python/cpython/issues/156864
gh-156867https://github.com/python/cpython/issues/156867
https://github.com/skirpichev
skirpichevhttps://github.com/skirpichev
on Sep 3, 2026https://github.com/python/cpython/issues/156865#issuecomment-5524904215
#156864https://github.com/python/cpython/issues/156864
#156867https://github.com/python/cpython/issues/156867
evil planhttps://github.com/python/cpython/issues/156865#issuecomment-5520437382
vstinnerhttps://github.com/vstinner
struct.pack() doesn't checks overflows for native 'Zf' format type #156867https://github.com/python/cpython/issues/156867
on Sep 3, 2026https://github.com/python/cpython/issues/156865#event-30488277712
vstinnerhttps://github.com/vstinner
array.array() setter incorrectly handle overflows for 'e' type code #156864https://github.com/python/cpython/issues/156864
on Sep 3, 2026https://github.com/python/cpython/issues/156865#event-30488283555
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Sep 3, 2026https://github.com/python/cpython/issues/156865#issuecomment-5525893878
vstinnerhttps://github.com/vstinner
on Sep 3, 2026https://github.com/python/cpython/issues/156865#event-30488464606
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Sep 3, 2026https://github.com/python/cpython/issues/156865#issuecomment-5526128341
https://github.com/skirpichev
skirpichevhttps://github.com/skirpichev
on Sep 4, 2026https://github.com/python/cpython/issues/156865#issuecomment-5533942915
skirpichevhttps://github.com/skirpichev
on Sep 4, 2026https://github.com/python/cpython/issues/156865#event-30542947805
skirpichevhttps://github.com/skirpichev
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
on Sep 4, 2026https://github.com/python/cpython/issues/156865#event-30542973852
vstinnerhttps://github.com/vstinner
on Sep 18, 2026https://github.com/python/cpython/issues/156865#event-31398966800
gh-156865: Correctly detect overflows for array's "e", "f" and "Zf" t…https://github.com/python/cpython/commit/c0bc6fad254479629bbe5cf523a69263cbd28d49
gh-156865https://github.com/python/cpython/issues/156865
c0bc6fahttps://github.com/python/cpython/commit/c0bc6fad254479629bbe5cf523a69263cbd28d49
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Sep 18, 2026https://github.com/python/cpython/issues/156865#issuecomment-5732379122
@encukouhttps://github.com/encukou
https://github.com/encukou
encukouhttps://github.com/encukou
on Sep 18, 2026https://github.com/python/cpython/issues/156865#issuecomment-5732597298
vstinnerhttps://github.com/vstinner
on Sep 23, 2026https://github.com/python/cpython/issues/156865#event-31679402716
gh-156865: Correctly handle float/complex overflows in memoryview (#1…https://github.com/python/cpython/commit/dce80460cc6172c6ec240ccef5ff61067d27ff07
gh-156865https://github.com/python/cpython/issues/156865
#1…https://github.com/python/cpython/pull/156916
dce8046https://github.com/python/cpython/commit/dce80460cc6172c6ec240ccef5ff61067d27ff07
gh-156865: Don't raise exceptions for ctypes.c_float_complex overflows (https://github.com/python/cpython/commit/5ec9283f0c69d7820b663d42437be0bdd8a8b5ae
gh-156865https://github.com/python/cpython/issues/156865
5ec9283https://github.com/python/cpython/commit/5ec9283f0c69d7820b663d42437be0bdd8a8b5ae
gh-156865: struct.pack() check for overflows for Zf type (#156868)https://github.com/python/cpython/commit/0b447baeaac43723be7d4903d90f22780cc7e374
gh-156865https://github.com/python/cpython/issues/156865
#156868https://github.com/python/cpython/pull/156868
0b447bahttps://github.com/python/cpython/commit/0b447baeaac43723be7d4903d90f22780cc7e374
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Sep 24, 2026https://github.com/python/cpython/issues/156865#issuecomment-5810731282
I wrote previouslyhttps://github.com/python/cpython/issues/156865#issuecomment-5525893878
vstinnerhttps://github.com/vstinner
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 24, 2026https://github.com/python/cpython/issues/156865#event-31740716093
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/156865
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/156865
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%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.