This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Crash in sqlite3.create_collation() with a string non encodable to utf8
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.1, Python 3.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: patch

Created on 2010-03-21 23:37 by vstinner, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
sqlite_collation-py3k.patch vstinner, 2010-03-21 23:39
Messages (4)
msg101468 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-03-21 23:37
sqlite.connect(":memory:").create_collation, "\uDC80", collation_cb) because _PyUnicode_AsString() returns NULL and error, and the result is not checked.

Attached patch fixes the crash.

I didn't checked if the problem does also concern Python 2.x.
msg101469 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-03-21 23:39
(oops, my patch included tabulations!)
msg101476 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-03-22 01:32
My first sentence doesn't mean anything! I wanted to write:

sqlite.connect(":memory:").create_collation, "\uDC80", collation_cb) crashs because _PyUnicode_AsString() returns NULL on error, and the result is not checked.
msg103951 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-22 11:25
Fixed by r80349 (py3k), r80351 (3.1).
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52442
2010-04-22 11:25:35vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg103951
2010-03-22 01:32:09vstinnersetmessages: + msg101476
2010-03-21 23:39:47vstinnersetfiles: + sqlite_collation-py3k.patch

messages: + msg101469
2010-03-21 23:39:27vstinnersetfiles: - sqlite_collation-py3k.patch
2010-03-21 23:37:03vstinnercreate