Erlend Egeberg Aasland <erlend.aasl...@innova.no> added the comment:

> If sqlite3_value_blob() returns NULL, we should check if sqlite3_errcode() 
> equals SQLITE_NOMEM and raise MemoryError if it does.

This also applies to sqlite3_value_text().

It also applies to sqlite3_value_bytes() if a conversion takes place. We don't 
need to care about that as long as we call sqlite3_value_bytes() after 
conversion.

Also, PyTuple_SetItem() errors are not checked.

I would also suggest using PyUnicode_FromStringAndSize() iso. 
PyUnicode_FromString() in case SQLITE_TEXT, to avoid the unneeded strlen(). 
After sqlite3_value_text() is called, we can just use sqlite3_value_bytes(), 
since the length is precomputed as a result of the conversion.

Berker, would you allow a PR to improve all these issues in 
_pysqlite_build_py_params(), or would you prefer them split up in multiple PR's?

----------

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

Reply via email to