Aviv Palivoda added the comment:

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...

----------
nosy: +palaviv

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29021>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to