Title: sqlite: Raise ProgrammingError when operating on a closed connection in Blob methods · Issue #6289 · RustPython/RustPython · GitHub
Open Graph Title: sqlite: Raise ProgrammingError when operating on a closed connection in Blob methods · Issue #6289 · RustPython/RustPython
X Title: sqlite: Raise ProgrammingError when operating on a closed connection in Blob methods · Issue #6289 · RustPython/RustPython
Description: Currently, the sqlite3 module does not strictly enforce checks when methods are called on a Blob instance if the underlying connection is closed. While the read() method includes this check, other methods do not, leading to potential inc...
Open Graph Description: Currently, the sqlite3 module does not strictly enforce checks when methods are called on a Blob instance if the underlying connection is closed. While the read() method includes this check, other ...
X Description: Currently, the sqlite3 module does not strictly enforce checks when methods are called on a Blob instance if the underlying connection is closed. While the read() method includes this check, other ...
Opengraph URL: https://github.com/RustPython/RustPython/issues/6289
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite: Raise ProgrammingError when operating on a closed connection in Blob methods","articleBody":"Currently, the `sqlite3` module does not strictly enforce checks when methods are called on a `Blob` instance if the underlying connection is closed. While the `read()` method includes this check, other methods do not, leading to potential inconsistencies with CPython behavior.\n\n**Expected Behavior**\nTo match CPython's behavior, calling blob methods like `write()`, `tell()`, `seek()`, etc., on a closed database connection should raise a `sqlite3.ProgrammingError`.\n\n**Context**\nThis issue was identified during the review of PR #6286. The following methods in `crates/stdlib/src/sqlite.rs` are missing the `self.connection.is_closed()` check before calling `self.inner(vm)`:\n\n- `write()`\n- `tell()`\n- `seek()`\n- `__enter__()`\n- `__exit__()`\n- `__getitem__` (subscript)\n- `__setitem__` (ass_subscript)\n\n**Reference**\n- PR: https://github.com/RustPython/RustPython/pull/6286\n- Review comment: https://github.com/RustPython/RustPython/pull/6286#discussion_r2549598814","author":{"url":"https://github.com/ever0de","@type":"Person","name":"ever0de"},"datePublished":"2025-11-22T16:11:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/6289/RustPython/issues/6289"}
| 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:6e1c1638-7758-38c8-d217-634872621671 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA54:378C0F:1E72991:29F39B9:696AB7AA |
| html-safe-nonce | 9ca95e0100529001ab7813be528c35a8c6a5ab8eb89f9c72e96adda595afa489 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTU0OjM3OEMwRjoxRTcyOTkxOjI5RjM5Qjk6Njk2QUI3QUEiLCJ2aXNpdG9yX2lkIjoiNjAwODUwNTM0NzMwOTQ4Mzk0NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a5da261fbbbc2182716c7414104002830b7e11a7ec4fbdc99e0e2e3bfebedd3b |
| hovercard-subject-tag | issue:3654826960 |
| 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/RustPython/RustPython/6289/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4f96a92c0d29aa44bc8654813659f837f664e85e13221b8d75daba760bea9e57/RustPython/RustPython/issues/6289 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4f96a92c0d29aa44bc8654813659f837f664e85e13221b8d75daba760bea9e57/RustPython/RustPython/issues/6289 |
| og:image:alt | Currently, the sqlite3 module does not strictly enforce checks when methods are called on a Blob instance if the underlying connection is closed. While the read() method includes this check, other ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ever0de |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4fa1799b6a53c2d30c950d74230781bef9e7f61138c72c7727e4b83f0743752b |
| turbo-cache-control | no-preview |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| 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 | 41f276818bd204c4a30a0281fb3c576298d9474c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width