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.

Author palaviv
Recipients Ingo Ruhnke, ghaering, palaviv
Date 2017-01-04.22:07:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483567643.56.0.71569603838.issue29021@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is in _pysqlite_build_py_params function at connection.c. In case we have text we do the following code:

case SQLITE_TEXT:
      val_str = (const char*)sqlite3_value_text(cur_value);
      cur_py_value = PyUnicode_FromString(val_str);
      /* TODO: have a way to show errors here */
      if (!cur_py_value) {
             PyErr_Clear();
             Py_INCREF(Py_None);
             cur_py_value = Py_None;
      }
      break;

As you can see we call PyUnicode_FromString instead of text_factory.

I started making a patch to fix this by passing the text_factory to _pysqlite_build_py_params function but I currently have a problem with setting the result to the sqlite. User text_factory may return any type of object and I can't see how to handle that...
History
Date User Action Args
2017-01-04 22:07:23palavivsetrecipients: + palaviv, ghaering, Ingo Ruhnke
2017-01-04 22:07:23palavivsetmessageid: <1483567643.56.0.71569603838.issue29021@psf.upfronthosting.co.za>
2017-01-04 22:07:23palavivlinkissue29021 messages
2017-01-04 22:07:23palavivcreate