Use encode() in zerver/lib/message.py.

This commit is contained in:
Steve Howell 2017-11-04 08:25:20 -07:00 committed by Tim Abbott
parent d42478bfea
commit 63024b3a6f
1 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ from zerver.lib.cache import (
to_dict_cache_key_id,
)
from zerver.lib.request import JsonableError
from zerver.lib.str_utils import force_bytes, dict_with_str_keys
from zerver.lib.str_utils import dict_with_str_keys
from zerver.lib.stream_subscription import (
get_stream_subscriptions_for_user,
)
@ -115,7 +115,7 @@ def extract_message_dict(message_bytes):
def stringify_message_dict(message_dict):
# type: (Dict[str, Any]) -> bytes
return zlib.compress(force_bytes(ujson.dumps(message_dict)))
return zlib.compress(ujson.dumps(message_dict).encode())
@cache_with_key(to_dict_cache_key, timeout=3600*24)
def message_to_dict_json(message):