From a39d45d03c6afa2b3967d1f865f8a301b338edbc Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 9 Oct 2019 13:42:17 -0400 Subject: [PATCH] Fix some more python3 issues --- confluent_server/confluent/log.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/log.py b/confluent_server/confluent/log.py index 8a978490..ee2444c1 100644 --- a/confluent_server/confluent/log.py +++ b/confluent_server/confluent/log.py @@ -600,7 +600,11 @@ class Logger(object): if ltype == 2: textrecord = data else: - textrecord = textdate + data + ']' + if not isinstance(textdate, bytes): + textdate = textdate.encode('utf-8') + if not isinstance(data, bytes): + data = data.encode('utf-8') + textrecord = textdate + data + b']' else: textrecord = textdate + data if not textrecord.endswith('\n'): @@ -798,4 +802,4 @@ def logtrace(): if tracelog is None: tracelog = Logger('trace', buffered=False) tracelog.log(traceback.format_exc(), ltype=DataTypes.event, - event=Events.stacktrace) \ No newline at end of file + event=Events.stacktrace)