mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-30 02:46:41 -05: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
|
|
@ -27,7 +27,7 @@ class MariaEngine(object):
|
|||
|
||||
def encode_parameter(self, param):
|
||||
if isinstance(param, types.BufferType):
|
||||
return str(param)
|
||||
return bytes(param)
|
||||
return param
|
||||
|
||||
def on_new_connection(self, db_conn):
|
||||
|
|
@ -45,3 +45,6 @@ class MariaEngine(object):
|
|||
if isinstance(error, self.module.DatabaseError):
|
||||
return error.sqlstate == "40001" and error.errno == 1213
|
||||
return False
|
||||
|
||||
def load_unicode(self, v):
|
||||
return bytes(v).decode("UTF8")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue