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
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ghaering Nosy List: ghaering, haypo, pitrou
Priority: normal Keywords: patch

Created on 2009-12-11 12:11 by haypo, last changed 2010-03-05 09:24 by ghaering. This issue is now closed.

File name Uploaded Description Edit
_sqlite3_setdict.patch haypo, 2009-12-11 12:13
Messages (6)
msg96248 - (view) Author: STINNER Victor (haypo) * (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

I've integrated this into pysqlite
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 (haypo) * (Python committer) Date: 2010-01-09 18:56
So, would this fix be part of python 2.7?
msg98638 - (view) Author: STINNER Victor (haypo) * (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!
Date User Action Args
2010-03-05 09:24:40ghaeringsetstatus: open -> closed
resolution: fixed
messages: + msg100457
2010-01-31 23:54:27hayposetmessages: + msg98638
2010-01-09 18:56:10hayposetmessages: + 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:11hayposetfiles: + _sqlite3_setdict.patch
keywords: + patch
2009-12-11 12:11:18haypocreate