5
sqlite3.ProgrammingError: Ви не повинні використовувати 8-бітові bytestring, якщо ви не використовуєте text_factory, який може інтерпретувати 8-бітні bytestrings
Використовуючи SQLite3 в Python, я намагаюся зберегти стиснуту версію фрагмента HTML-коду UTF-8. Код виглядає так: ... c = connection.cursor() c.execute('create table blah (cid integer primary key,html blob)') ... c.execute('insert or ignore into blah values (?, ?)',(cid, zlib.compress(html))) У цей момент отримати помилку: sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless …