|
Python crash with non-UTF8 and invalid timestamp combination: msg#00067python.db.pysqlite.user
I hope I've narrowed this down as as far as it can go. I'm experiencing a situation where pysqlite appears to be crashing python.exe under Windows. pysqlite: 2.2.1 sqlite: 3.3.5 python: 2.4.3 (from python.org) Windows: XP Professional SP2 It appears to occur only when a text field contains invalid UTF-8 data and there is a timestamp field with auto-conversion turned on. The example below consistently reproduces a crash -- ie a Windows dialog box complaining that "python.exe has encountered a problem and needs to close. We are sorry for the inconvenience." Specific points to note: 1) The detect_types clause must be present for failure to occur 2) Both columns must be present for failure to occur 3) The TEXT field must be invalid UTF-8 (afaict). 4) It doesn't seem to matter what's in the timestamp field. 5) The row must be iterated over -- ie the list (row) is essential This isn't a showstopper for me; I can just correct the invalid UTF-8, which I suspect is some kind of Windows special quotes in text supplied by another user. But it's so unusual to see something in Python actually crash enough to take the interpreter down! TJG <code> from pysqlite2 import dbapi2 as sqlite print sqlite.version, sqlite.sqlite_version db = sqlite.connect (":memory:", detect_types=sqlite.PARSE_DECLTYPES) db.execute ("CREATE TABLE t (a TEXT, d timestamp)") db.execute ("INSERT INTO t (a, d) VALUES (?, ?)", ["\xf4", ""]) for row in db.execute ("SELECT * FROM t"): print row, list (row) </code> |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Help for PySQLite Install on debian sarge: 00067, Emmanuel Vaïsse |
|---|---|
| Next by Date: | Re: Python crash with non-UTF8 and invalid timestamp combination: 00067, Gerhard Häring |
| Previous by Thread: | Help for PySQLite Install on debian sargei: 00067, Emmanuel Vaïsse |
| Next by Thread: | Re: Python crash with non-UTF8 and invalid timestamp combination: 00067, Gerhard Häring |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |