[New-bugs-announce] [issue7478] _sqlite3 doesn't catch PyDict_SetItem error

STINNER Victor report at bugs.python.org
Fri Dec 11 13:11:19 CET 2009


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

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).

----------
components: Extension Modules
messages: 96248
nosy: haypo
severity: normal
status: open
title: _sqlite3 doesn't catch PyDict_SetItem error
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7478>
_______________________________________


More information about the New-bugs-announce mailing list