Title: sqlite3.Blob slice assignment with a step corrupts an immortal bytes singleton · Issue #155702 · python/cpython · GitHub
Open Graph Title: sqlite3.Blob slice assignment with a step corrupts an immortal bytes singleton · Issue #155702 · python/cpython
X Title: sqlite3.Blob slice assignment with a step corrupts an immortal bytes singleton · Issue #155702 · python/cpython
Description: Crash report import sqlite3 cx = sqlite3.connect(":memory:") cx.execute("create table t(b blob)") cx.execute("insert into t values (?)", (b"abcdefghij",)) blob = cx.blobopen("t", "b", 1) blob[5:6:2] = b"\xab" print(bytes([102])) # b'\xab...
Open Graph Description: Crash report import sqlite3 cx = sqlite3.connect(":memory:") cx.execute("create table t(b blob)") cx.execute("insert into t values (?)", (b"abcdefghij",)) blob = cx.blobopen("t", "b", 1) blob[5:6:2...
X Description: Crash report import sqlite3 cx = sqlite3.connect(":memory:") cx.execute("create table t(b blob)") cx.execute("insert into t values (?)", (b"abcdefghij",)) bl...
Opengraph URL: https://github.com/python/cpython/issues/155702
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite3.Blob slice assignment with a step corrupts an immortal bytes singleton","articleBody":"# Crash report\n\n```python\nimport sqlite3\ncx = sqlite3.connect(\":memory:\")\ncx.execute(\"create table t(b blob)\")\ncx.execute(\"insert into t values (?)\", (b\"abcdefghij\",))\nblob = cx.blobopen(\"t\", \"b\", 1)\n\nblob[5:6:2] = b\"\\xab\"\n\nprint(bytes([102])) # b'\\xab', expected b'f'\nprint(b\"f\" == b\"\\xab\") # True\n```\n\n`ass_subscript_slice()` reads the affected region, patches it and writes it back, using the object returned by `read_multiple()` as the buffer.\nFor a single byte that object is an immortal singleton, so writing into it changes the value of that byte in the whole process.\n\nThis is a regression in 243d599a05e (gh-129813, GH-138956), which changed `read_multiple()` to use `PyBytesWriter`.\nOnly main and 3.15 are affected.\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-155703\n* gh-155765\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2026-08-13T13:01:47Z","url":"https://github.com/python/cpython/issues/155702"}
| 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:297138d7-3d94-6a9a-9253-14736c4c7fe8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A612:313081:1202FCA:17CB717:6B01E438 |
| html-safe-nonce | bc18ddca568965a88f99dafb943857cbfce52eafa2151540dff17ef2aa4d8ab4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjEyOjMxMzA4MToxMjAyRkNBOjE3Q0I3MTc6NkIwMUU0MzgiLCJ2aXNpdG9yX2lkIjoiMTA2OTQ5Mzg1NDAzMTQzODkwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9a52e9ad1e7763c0b2f354bb1ccca1854bd431a3c9755544e36c16ac564b3783 |
| hovercard-subject-tag | issue:5141691517 |
| 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/155702/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b3751a71b51e7ad4a168d7b8711d3e9bb49c26a800aaaa36d1e0046f43a11060/python/cpython/issues/155702 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b3751a71b51e7ad4a168d7b8711d3e9bb49c26a800aaaa36d1e0046f43a11060/python/cpython/issues/155702 |
| og:image:alt | Crash report import sqlite3 cx = sqlite3.connect(":memory:") cx.execute("create table t(b blob)") cx.execute("insert into t values (?)", (b"abcdefghij",)) blob = cx.blobopen("t", "b", 1) blob[5:6:2... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width