[issue12569] sqlite3 segfaults and bus errors when given certain unicode strings as queries

STINNER Victor report at bugs.python.org
Fri Jul 15 09:50:54 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

I already fixed this issue in Python 3.1, 3.2 and 3.3: issue #6697 (e.g. commit 7ba851d1b46e).

$ ./python 
Python 3.3.0a0 (default:ab162f925761, Jul 15 2011, 09:36:17) 
>>> import sqlite3
>>> c = sqlite3.connect(":memory:")
>>> table_name = '"' + chr(0xD800) + '"'
>>> c.execute("create table " + table_name + " (bar)")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 14: surrogates not allowed

@jeremybanks: I don't think that you use sqlite3 coming from Python 3 but the third party module.

----------
nosy: +haypo

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


More information about the Python-bugs-list mailing list