diff options
author | Erik Johnston <erik@matrix.org> | 2015-04-10 13:41:54 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-04-10 13:41:54 +0100 |
commit | 7ed2ec3061b12ad79f3bd07da8758c5e41af8e5e (patch) | |
tree | 2172b59fd044f027b6c7b2fa031fd3c04e1219c7 /synapse/storage/_base.py | |
parent | Bump schema version (diff) | |
download | synapse-7ed2ec3061b12ad79f3bd07da8758c5e41af8e5e.tar.xz |
Handle the fact that in sqlite binary data might be stored as unicode or bytes
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r-- | synapse/storage/_base.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index c1bf98cdcb..e30514cd5e 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -812,6 +812,9 @@ class SQLBaseStore(object): internal_metadata, js, redacted, rejected_reason = res + internal_metadata = self.database_engine.load_unicode(internal_metadata) + js = self.database_engine.load_unicode(js) + start_time = update_counter("select_event", start_time) result = self._get_event_from_row_txn( @@ -839,11 +842,11 @@ class SQLBaseStore(object): return curr_time logger.debug("Got js: %r", js) - d = json.loads(str(js).decode("utf8")) + d = json.loads(js) start_time = update_counter("decode_json", start_time) logger.debug("Got internal_metadata: %r", internal_metadata) - internal_metadata = json.loads(str(internal_metadata).decode("utf8")) + internal_metadata = json.loads(internal_metadata) start_time = update_counter("decode_internal", start_time) ev = FrozenEvent( |