[issue16783] sqlite3 accepts strings it cannot (by default) return

Ezio Melotti report at bugs.python.org
Sun Dec 30 17:32:42 CET 2012


Ezio Melotti added the comment:

> Treating invalid data as sometimes valid and sometime as invalid is a problem. 

What is valid is defined by your application.  AFAIU sqlite3 defaults to utf-8, but it's able to work with latin1 data as well.  The fact that you are mixing utf-8 and latin1 is an error in your application, and while it might be nice if sqlite3 warned you about it, it's not necessarily its responsibility.  Even thought it's a really bad idea, you might want to store data with different encodings and still being able to retrieve them using the right text_factory.

However while trying to reproduce the issue I noticed a possible inconsistency and reported it on #6010.

----------
stage:  -> committed/rejected
superseder:  -> unable to retrieve latin-1 encoded data from sqlite3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16783>
_______________________________________


More information about the Python-bugs-list mailing list