summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/connection.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-09-11 10:29:05 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-09-11 10:29:05 (GMT)
commit42d67af87fc2b1d297cce1cd8d762461e009f0a0 (patch)
treee9ad2265f9dc6bd1f5aee05f8bc64b0d45a4d3fd /Modules/_sqlite/connection.c
parentabf68ce16474a2d252723099f1c7a6d640191123 (diff)
downloadcpython-42d67af87fc2b1d297cce1cd8d762461e009f0a0.zip
cpython-42d67af87fc2b1d297cce1cd8d762461e009f0a0.tar.gz
cpython-42d67af87fc2b1d297cce1cd8d762461e009f0a0.tar.bz2
Issue #21147: sqlite3 now raises an exception if the request contains a null
character instead of truncate it. Based on patch by Victor Stinner.
Diffstat (limited to 'Modules/_sqlite/connection.c')
-rw-r--r--Modules/_sqlite/connection.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 882424b..535464d 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1261,7 +1261,8 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py
if (rc == PYSQLITE_TOO_MUCH_SQL) {
PyErr_SetString(pysqlite_Warning, "You can only execute one statement at a time.");
} else if (rc == PYSQLITE_SQL_WRONG_TYPE) {
- PyErr_SetString(pysqlite_Warning, "SQL is of wrong type. Must be string or unicode.");
+ if (PyErr_ExceptionMatches(PyExc_TypeError))
+ PyErr_SetString(pysqlite_Warning, "SQL is of wrong type. Must be string.");
} else {
(void)pysqlite_statement_reset(statement);
_pysqlite_seterror(self->db, NULL);