From fe618e3b0f22861abbe61aab2ac2e804662c6723 Mon Sep 17 00:00:00 2001 From: Ramon Figueiredo Pessoa Date: Wed, 17 Jan 2024 13:11:02 -0800 Subject: [PATCH] [rqd] Fix non ASCII chars Convert to ASCII while discarding characters that can not be encoded --- rqd/rqd/rqcore.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rqd/rqd/rqcore.py b/rqd/rqd/rqcore.py index 842028732..70bb949d1 100644 --- a/rqd/rqd/rqcore.py +++ b/rqd/rqd/rqcore.py @@ -1219,6 +1219,8 @@ def print_and_flush_ln(fd, last_timestamp): remainder = lines[-1] for line in lines[0:-1]: + # Convert to ASCII while discarding characters that can not be encoded + line = line.encode('ascii', 'ignore') print("[%s] %s" % (curr_line_timestamp, line), file=outfile) outfile.flush() os.fsync(outfile)