[New-bugs-announce] [issue3312] bugs in _sqlite module

STINNER Victor report at bugs.python.org
Mon Jul 7 15:16:52 CEST 2008


New submission from STINNER Victor <haypo at users.sourceforge.net>:

(A) module_register_adapter() doesn't check microprotocols_add() 
result, whereas it can fails (eg. dict setitem error). 
Example: "import _sqlite3; _sqlite3.register_adapter({}, None)" => 
should raise a TypeError (unhashable type: 'dict').

(B) Connection.set_isolation_level() tries to create the 
string "BEGIN "+isolation_level and the store it as PyString in 
begin_statement. But if the result can not be converted to string, 
Python crashs. Example:

>>> import _sqlite3
>>> c=_sqlite3.Connection("a")
>>> c.isolation_level = u"\xe9"
Erreur de segmentation (core dumped)

Attached patch fix the two bugs.

----------
components: Library (Lib)
files: _sqlite.patch
keywords: patch
messages: 69387
nosy: haypo
severity: normal
status: open
title: bugs in _sqlite module
versions: Python 2.6
Added file: http://bugs.python.org/file10841/_sqlite.patch

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


More information about the New-bugs-announce mailing list