This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _sqlite3 doesn't catch PyDict_SetItem error
Type: crash Stage: patch review
Components: Extension Modules Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ghaering Nosy List: ghaering, pitrou, vstinner
Priority: normal Keywords: patch

Created on 2009-12-11 12:11 by vstinner, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
_sqlite3_setdict.patch vstinner, 2009-12-11 12:13
Messages (6)
msg96248 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-12-11 12:11
Methods create_function, create_aggregate, set_authorizer, 
set_progress_handler, create_collation of the _sqlite3.Connection class 
doesn't catch PyDict_SetItem/PyDict_DelItem errors. The error will be 
catched by next opcode/function call.

The error occurs if the callback argument is not hashable.

Attached patch adds the missing tests, and add unit tests.

There is not unit test for Connection.create_collation() because I don't 
know how to test it. The call to PyDict_SetItem() is different, because 
the callback is not the dictionary key but the value (so it's not a 
problem if the callback is not hashable).
msg96563 - (view) Author: Gerhard Häring (ghaering) * (Python committer) Date: 2009-12-18 14:24
Thanks!

I've integrated this into pysqlite
(http://code.google.com/p/pysqlite/source/detail?r=6455981b3283b26c147d949a9031a0d74ea7ffe8)
and will soon push updates to the version in Python core.

In my opinion this changes is not critical enough to warrant pushing it
into Python 2.6. Do you agree?
msg96564 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-12-18 14:28
It should be backported to Python 2.6, like any bug fix (and especially
when it's about a crasher).
msg97468 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-01-09 18:56
So, would this fix be part of python 2.7?
msg98638 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-01-31 23:54
ghaering> I will soon push updates to the version in Python core.

What do you mean by "soon"?
msg100457 - (view) Author: Gerhard Häring (ghaering) * (Python committer) Date: 2010-03-05 09:24
Fixed in trunk now. Thanks!
History
Date User Action Args
2022-04-11 14:56:55adminsetgithub: 51727
2010-03-05 09:24:40ghaeringsetstatus: open -> closed
resolution: fixed
messages: + msg100457
2010-01-31 23:54:27vstinnersetmessages: + msg98638
2010-01-09 18:56:10vstinnersetmessages: + msg97468
2009-12-18 14:28:29pitrousetnosy: + pitrou
messages: + msg96564
2009-12-18 14:24:44ghaeringsetassignee: ghaering
messages: + msg96563
2009-12-11 13:09:43pitrousetversions: + Python 2.6, Python 3.1, Python 3.2
nosy: + ghaering

priority: normal
type: crash
stage: patch review
2009-12-11 12:13:11vstinnersetfiles: + _sqlite3_setdict.patch
keywords: + patch
2009-12-11 12:11:18vstinnercreate