Skip to content

Commit

Permalink
[rqd] Fix non ASCII chars
Browse files Browse the repository at this point in the history
Convert to ASCII while discarding characters that can not be encoded
  • Loading branch information
ramonfigueiredo committed Jan 17, 2024
1 parent fe519e3 commit fe618e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rqd/rqd/rqcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fe618e3

Please sign in to comment.