classification
Title: bugs in _sqlite module
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, haypo
Priority: normal Keywords: patch

Created on 2008-07-07 13:16 by haypo, last changed 2008-07-16 22:33 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
_sqlite.patch haypo, 2008-07-07 13:16 Patch to fix described bugs
Messages (2)
msg69387 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2008-07-07 13:16
(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.
msg69850 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-16 22:33
Thanks, fixed in r65040.
History
Date User Action Args
2008-07-16 22:33:35georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg69850
nosy: + georg.brandl
2008-07-07 13:16:51haypocreate