# HG changeset patch # User RhodeCode Admin # Date 2023-03-20 09:20:15 # Node ID 21ca2ee2b43daf97422334ac0df31f2de9e9ddc6 # Parent 1163d324e1df3886c36102ae3f928208eb305814 channelstream: don't use json.dump, and replace it with dumps diff --git a/rhodecode/lib/channelstream.py b/rhodecode/lib/channelstream.py --- a/rhodecode/lib/channelstream.py +++ b/rhodecode/lib/channelstream.py @@ -209,15 +209,16 @@ def update_history_from_logs(config, cha def write_history(config, message): - """ writes a messge to a base64encoded filename """ + """ writes a message to a base64encoded filename """ history_location = config.get('history.location') if not os.path.exists(history_location): return try: LOCK.acquire_write_lock() filepath = log_filepath(history_location, message['channel']) + json_message = json.dumps(message) with open(filepath, 'ab') as f: - json.dump(message, f) + f.write(json_message) f.write('\n') finally: LOCK.release_write_lock()