Title: int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero · Issue #71810 · python/cpython · GitHub
Open Graph Title: int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero · Issue #71810 · python/cpython
X Title: int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero · Issue #71810 · python/cpython
Description: BPO 27623 Nosy @mdickinson, @socketpair, @vadmium, @serhiy-storchaka, @Vgr255, @lucasem, @Phaqui Files int_to_bytes_overflow_1.patchint_to_bytes_overflow_cornercase.patch: Throws OverflowError on (-1).to_bytes(0, 'big', signed=True)int_t...
Open Graph Description: BPO 27623 Nosy @mdickinson, @socketpair, @vadmium, @serhiy-storchaka, @Vgr255, @lucasem, @Phaqui Files int_to_bytes_overflow_1.patchint_to_bytes_overflow_cornercase.patch: Throws OverflowError on (...
X Description: BPO 27623 Nosy @mdickinson, @socketpair, @vadmium, @serhiy-storchaka, @Vgr255, @lucasem, @Phaqui Files int_to_bytes_overflow_1.patchint_to_bytes_overflow_cornercase.patch: Throws OverflowError on (...
Opengraph URL: https://github.com/python/cpython/issues/71810
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero","articleBody":"BPO | [27623](https://bugs.python.org/issue27623)\n--- | :---\nNosy | @mdickinson, @socketpair, @vadmium, @serhiy-storchaka, @Vgr255, @lucasem, @phaqui\nFiles | \u003cli>[int_to_bytes_overflow_1.patch](https://bugs.python.org/file43913/int_to_bytes_overflow_1.patch \"Uploaded as text/plain at 2016-07-28.02:28:36 by @Vgr255\")\u003c/li>\u003cli>[int_to_bytes_overflow_cornercase.patch](https://bugs.python.org/file43925/int_to_bytes_overflow_cornercase.patch \"Uploaded as text/plain at 2016-07-28.16:17:27 by @phaqui\"): Throws OverflowError on (-1).to_bytes(0, 'big', signed=True)\u003c/li>\u003cli>[int_to_bytes_overflow_cornercase2.patch](https://bugs.python.org/file43942/int_to_bytes_overflow_cornercase2.patch \"Uploaded as text/plain at 2016-07-30.00:01:17 by @phaqui\"): (-x).to_bytes(0, 'big', signed=True), x=0 or -1 now throws OverflowError; also updated the tests. They run successfully.\u003c/li>\n\n\u003csup>*Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.*\u003c/sup>\n\n\u003cdetails>\u003csummary>Show more details\u003c/summary>\u003cp>\n\nGitHub fields:\n```python\nassignee = None\nclosed_at = None\ncreated_at = \u003cDate 2016-07-26.06:26:20.726>\nlabels = ['interpreter-core', 'type-bug']\ntitle = 'int.to_bytes() and int.from_bytes(): raise ValueError when bytes count is zero'\nupdated_at = \u003cDate 2016-07-30.01:21:55.777>\nuser = 'https://github.com/socketpair'\n```\n\nbugs.python.org fields:\n```python\nactivity = \u003cDate 2016-07-30.01:21:55.777>\nactor = 'martin.panter'\nassignee = 'none'\nclosed = False\nclosed_date = None\ncloser = None\ncomponents = ['Interpreter Core']\ncreation = \u003cDate 2016-07-26.06:26:20.726>\ncreator = 'socketpair'\ndependencies = []\nfiles = ['43913', '43925', '43942']\nhgrepos = []\nissue_num = 27623\nkeywords = ['patch']\nmessage_count = 14.0\nmessages = ['271329', '271330', '271476', '271479', '271484', '271485', '271487', '271499', '271504', '271506', '271564', '271565', '271657', '271660']\nnosy_count = 7.0\nnosy_names = ['mark.dickinson', 'socketpair', 'martin.panter', 'serhiy.storchaka', 'abarry', 'lucasem', 'Phaqui']\npr_nums = []\npriority = 'normal'\nresolution = None\nstage = 'patch review'\nstatus = 'open'\nsuperseder = None\ntype = 'behavior'\nurl = 'https://bugs.python.org/issue27623'\nversions = ['Python 3.6']\n```\n\n\u003c/p>\u003c/details>\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-138739\n* gh-138782\n* gh-138783\n* gh-138873\n* gh-138883\n* gh-138884\n\u003c!-- /gh-linked-prs -->\n","author":{"url":null,"@type":"Person","name":"socketpair"},"datePublished":"2016-07-26T06:26:21Z","url":"https://github.com/python/cpython/issues/71810"}
| 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:f39d2e43-de76-094d-5d36-c910e0ffdf8e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 899E:215B92:32A43AC:4379E19:6B01F3DE |
| html-safe-nonce | 71ed292225dd918f5c3167576116f10f4482e80343fd6e82760d2daf4134506f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTlFOjIxNUI5MjozMkE0M0FDOjQzNzlFMTk6NkIwMUYzREUiLCJ2aXNpdG9yX2lkIjoiMjMyMzk0ODk2MTA0MTM0NzU1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f8a84c2675e81325d1eb62638af9daba5cef1f61749e0af7803d3044993b7d35 |
| hovercard-subject-tag | issue:1198956046 |
| 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/71810/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9e49256c614261211ecb8ed35db282cedfd0206543172e88e01fa653fd2fc6c3/python/cpython/issues/71810 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9e49256c614261211ecb8ed35db282cedfd0206543172e88e01fa653fd2fc6c3/python/cpython/issues/71810 |
| og:image:alt | BPO 27623 Nosy @mdickinson, @socketpair, @vadmium, @serhiy-storchaka, @Vgr255, @lucasem, @Phaqui Files int_to_bytes_overflow_1.patchint_to_bytes_overflow_cornercase.patch: Throws OverflowError on (... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | socketpair |
| 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