[Python-checkins] cpython: Issue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call

victor.stinner python-checkins at python.org
Thu Jul 18 01:57:33 CEST 2013


http://hg.python.org/cpython/rev/9bae7696951f
changeset:   84705:9bae7696951f
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Jul 18 01:54:37 2013 +0200
summary:
  Issue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call
type_call() with an exception set

files:
  Modules/_sqlite/cursor.c |  5 +++++
  1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -339,6 +339,11 @@
                 if (self->connection->text_factory == (PyObject*)&PyUnicode_Type) {
                     converted = PyUnicode_FromStringAndSize(val_str, nbytes);
                     if (!converted) {
+#ifdef Py_DEBUG
+                        /* in debug mode, type_call() fails with an assertion
+                           error if an exception is set when it is called */
+                        PyErr_Clear();
+#endif
                         colname = sqlite3_column_name(self->statement->st, i);
                         if (!colname) {
                             colname = "<unknown column name>";

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list