Title: formatfloat wrong return in unicode_format.c · Issue #151845 · python/cpython · GitHub
Open Graph Title: formatfloat wrong return in unicode_format.c · Issue #151845 · python/cpython
X Title: formatfloat wrong return in unicode_format.c · Issue #151845 · python/cpython
Description: Bug report Bug description: Original gist: https://gist.github.com/devdanzin/577421b083bad6802aa391b909d1a725 formatfloat (line 163): Returns 0 (success) when _PyUnicode_FromASCII fails. Caller has safety net, but violates return-value c...
Open Graph Description: Bug report Bug description: Original gist: https://gist.github.com/devdanzin/577421b083bad6802aa391b909d1a725 formatfloat (line 163): Returns 0 (success) when _PyUnicode_FromASCII fails. Caller has...
X Description: Bug report Bug description: Original gist: https://gist.github.com/devdanzin/577421b083bad6802aa391b909d1a725 formatfloat (line 163): Returns 0 (success) when _PyUnicode_FromASCII fails. Caller has...
Opengraph URL: https://github.com/python/cpython/issues/151845
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"formatfloat wrong return in unicode_format.c","articleBody":"# Bug report\n\n### Bug description:\n\nOriginal gist: https://gist.github.com/devdanzin/577421b083bad6802aa391b909d1a725\n\n`formatfloat` (line 163): Returns 0 (success) when `_PyUnicode_FromASCII` fails. Caller has safety net, but violates return-value contract.\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 --\u003e\n### Linked PRs\n* gh-151846\n* gh-151865\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/aisk","@type":"Person","name":"aisk"},"datePublished":"2026-06-21T13:48:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/151845/cpython/issues/151845"}
| 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:c0811dd2-e340-fc08-eddb-cfa69dfa514f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9932:39978:A6AE924:AA37B8E:6A50B9D4 |
| html-safe-nonce | 5b80baac05b66ad458fe9edb731e325704ea561a21998d7115ea80438b5ad343 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTMyOjM5OTc4OkE2QUU5MjQ6QUEzN0I4RTo2QTUwQjlENCIsInZpc2l0b3JfaWQiOiI1NjkwMDYxMTY3OTAzODUxMDgiLCJyZWdpb25fZWRnZSI6InNlYSIsInJlZ2lvbl9yZW5kZXIiOiJzZWEifQ== |
| visitor-hmac | 607264c4eb9fd754287d0ceb1d59212d97cf198b280e2d827d5b3c059e67f3e7 |
| hovercard-subject-tag | issue:4710693832 |
| 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/151845/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1e02848eb0edc9762eb61baee77b033fe8fb21ce1c1e2b55905403cd5c540d4c/python/cpython/issues/151845 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1e02848eb0edc9762eb61baee77b033fe8fb21ce1c1e2b55905403cd5c540d4c/python/cpython/issues/151845 |
| og:image:alt | Bug report Bug description: Original gist: https://gist.github.com/devdanzin/577421b083bad6802aa391b909d1a725 formatfloat (line 163): Returns 0 (success) when _PyUnicode_FromASCII fails. Caller has... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aisk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0 |
| 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 | 08e79d53fc070870d5b168356afebb1e286a2ffe |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width