Title: sqlite3.Row.__hash__ raises SystemError instead of TypeError for an unhashable value · Issue #153695 · python/cpython · GitHub
Open Graph Title: sqlite3.Row.__hash__ raises SystemError instead of TypeError for an unhashable value · Issue #153695 · python/cpython
X Title: sqlite3.Row.__hash__ raises SystemError instead of TypeError for an unhashable value · Issue #153695 · python/cpython
Description: Bug description sqlite3.Row.__hash__ calls PyObject_Hash on the row's description and data without checking the -1 error return, so hashing a row that holds an unhashable value raises SystemError instead of TypeError: import sqlite3 sqli...
Open Graph Description: Bug description sqlite3.Row.__hash__ calls PyObject_Hash on the row's description and data without checking the -1 error return, so hashing a row that holds an unhashable value raises SystemError i...
X Description: Bug description sqlite3.Row.__hash__ calls PyObject_Hash on the row's description and data without checking the -1 error return, so hashing a row that holds an unhashable value raises SystemErr...
Opengraph URL: https://github.com/python/cpython/issues/153695
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite3.Row.__hash__ raises SystemError instead of TypeError for an unhashable value","articleBody":"### Bug description\n\n`sqlite3.Row.__hash__` calls `PyObject_Hash` on the row's description and data\nwithout checking the `-1` error return, so hashing a row that holds an\nunhashable value raises `SystemError` instead of `TypeError`:\n\n```python\nimport sqlite3\nsqlite3.register_converter(\"LST\", lambda b: [1, 2, 3])\ncon = sqlite3.connect(\":memory:\", detect_types=sqlite3.PARSE_DECLTYPES)\ncon.row_factory = sqlite3.Row\ncon.execute(\"create table t(x LST)\")\ncon.execute(\"insert into t values (?)\", (b\"x\",))\nrow = con.execute(\"select x from t\").fetchone()\nhash(row)\n# SystemError: \u003cbuilt-in function hash> returned a result with an exception set\n```\n\nExpected: `TypeError: unhashable type: 'list'`.\n\n### CPython versions tested on\n\n3.14, 3.15, 3.16\n\n### Operating systems tested on\n\nmacOS\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-153696\n* gh-153723\n* gh-153724\n* gh-153725\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/tonghuaroot","@type":"Person","name":"tonghuaroot"},"datePublished":"2026-07-14T12:07:48Z","url":"https://github.com/python/cpython/issues/153695"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:a19b908a-7b82-c846-e382-6da4642fa9c2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9114:22BC6A:398DBE:4FA0D2:6AECCA45 |
| html-safe-nonce | da0c153faf3ba9c4404e64dacc00b3097bee20dcaec991d6fdc9cf0a7d25d063 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTE0OjIyQkM2QTozOThEQkU6NEZBMEQyOjZBRUNDQTQ1IiwidmlzaXRvcl9pZCI6IjUyNDM4MzUwOTUxNDYzNTExNzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9857e20cdf9112547467cad17c5b61e3eaa478a89a4d28e67435a4eb14174114 |
| hovercard-subject-tag | issue:4882881429 |
| 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/153695/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b2ea7d958ef9baa3d9533673a29f7de2c871f1704e5ea43c0aa837108c68b2cb/python/cpython/issues/153695 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b2ea7d958ef9baa3d9533673a29f7de2c871f1704e5ea43c0aa837108c68b2cb/python/cpython/issues/153695 |
| og:image:alt | Bug description sqlite3.Row.__hash__ calls PyObject_Hash on the row's description and data without checking the -1 error return, so hashing a row that holds an unhashable value raises SystemError i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tonghuaroot |
| hostname | github.com |
| expected-hostname | github.com |
| None | dc0b519c5798dc1150b88dc4c06a8b9634d0069218dc04e469970e76aad74016 |
| 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 | db139f0bf57b59bf9a8c4abb0849924d6c6ca559 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width