Title: Assertion failure in Modules/_io/bytesio.c `_io_BytesIO_readinto_impl: Assertion 'self->pos + len < PY_SSIZE_T_MAX' failed.` · Issue #141311 · python/cpython · GitHub
Open Graph Title: Assertion failure in Modules/_io/bytesio.c `_io_BytesIO_readinto_impl: Assertion 'self->pos + len < PY_SSIZE_T_MAX' failed.` · Issue #141311 · python/cpython
X Title: Assertion failure in Modules/_io/bytesio.c `_io_BytesIO_readinto_impl: Assertion 'self->pos + len < PY_SSIZE_T_MAX' failed.` · Issue #141311 · python/cpython
Description: Bug report Bug description: import io input_lines = ['windows\r\n'] joined = ''.join(input_lines) encoding = 'utf-8' newline = None bufsize = 1 raw = io.BytesIO(joined.encode(encoding)) buf = io.BufferedReader(raw, buffer_size=bufsize) t...
Open Graph Description: Bug report Bug description: import io input_lines = ['windows\r\n'] joined = ''.join(input_lines) encoding = 'utf-8' newline = None bufsize = 1 raw = io.BytesIO(joined.encode(encoding)) buf = io.Bu...
X Description: Bug report Bug description: import io input_lines = ['windows\r\n'] joined = ''.join(input_lines) encoding = 'utf-8' newline = None bufsize = 1 raw = io.BytesIO(joined.encod...
Opengraph URL: https://github.com/python/cpython/issues/141311
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Assertion failure in Modules/_io/bytesio.c `_io_BytesIO_readinto_impl: Assertion 'self->pos + len \u003c PY_SSIZE_T_MAX' failed.`","articleBody":"# Bug report\n\n### Bug description:\n\n```python\nimport io\n\ninput_lines = ['windows\\r\\n']\njoined = ''.join(input_lines)\n\nencoding = 'utf-8'\nnewline = None\nbufsize = 1\n\nraw = io.BytesIO(joined.encode(encoding))\nbuf = io.BufferedReader(raw, buffer_size=bufsize)\ntextio = io.TextIOWrapper(buf, encoding=encoding, newline=newline)\n\ntextio.seek(2**63 - 1)\n_ = textio.read(2)\n```\n\n```\npython: ../Modules/_io/bytesio.c:616: _io_BytesIO_readinto_impl: Assertion `self->pos + len \u003c PY_SSIZE_T_MAX' failed.\nAborted (core dumped)\n```\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-141333\n* gh-141457\n* gh-141478\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/YuanchengJiang","@type":"Person","name":"YuanchengJiang"},"datePublished":"2025-11-09T18:08:44Z","url":"https://github.com/python/cpython/issues/141311"}
| 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:bc40b64f-9b4a-35cd-222c-da21d8e5c4ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A22E:2A98A:FA96E2:13B2840:6B024F1F |
| html-safe-nonce | 6eeb7fcc8271e4f2b75fd27ac0f6c8878a50f7537fc7b4c0b62dfcbb16c7ba85 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjJFOjJBOThBOkZBOTZFMjoxM0IyODQwOjZCMDI0RjFGIiwidmlzaXRvcl9pZCI6IjQ5MzUwOTc0NDQxNTg1NTc5ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6b5fc9ce7db2aabcdda4eb48f28a64336061a5e980d8ba1a7f439dc791d98daf |
| hovercard-subject-tag | issue:3605299711 |
| 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/141311/issue_layout |
| twitter:image | https://opengraph.githubassets.com/97aec4cdd0768a7068fcbd74d95b16c91eff8aeadd4c4dbb2603ebbbd934763c/python/cpython/issues/141311 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/97aec4cdd0768a7068fcbd74d95b16c91eff8aeadd4c4dbb2603ebbbd934763c/python/cpython/issues/141311 |
| og:image:alt | Bug report Bug description: import io input_lines = ['windows\r\n'] joined = ''.join(input_lines) encoding = 'utf-8' newline = None bufsize = 1 raw = io.BytesIO(joined.encode(encoding)) buf = io.Bu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | YuanchengJiang |
| 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 | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width