mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Handle the fact that in sqlite binary data might be stored as unicode or bytes
This commit is contained in:
parent
ce797ad373
commit
7ed2ec3061
5 changed files with 20 additions and 5 deletions
|
@ -15,6 +15,8 @@
|
|||
|
||||
from synapse.storage import prepare_database, prepare_sqlite3_database
|
||||
|
||||
import types
|
||||
|
||||
|
||||
class Sqlite3Engine(object):
|
||||
def __init__(self, database_module):
|
||||
|
@ -35,3 +37,8 @@ class Sqlite3Engine(object):
|
|||
|
||||
def is_deadlock(self, error):
|
||||
return False
|
||||
|
||||
def load_unicode(self, v):
|
||||
if isinstance(v, types.UnicodeType):
|
||||
return v
|
||||
return bytes(v).decode("UTF8")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue