Skip to content

Commit

Permalink
Replace print by sys.stdout.buffer.write (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Abadie authored May 7, 2024
1 parent 5c29750 commit 459cf20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tracking/translations_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ def _iter_log_entries(self) -> Iterator[tuple[list[tuple[str]], str]]:
"""
for line in self.logs_iter:
# When reading stdin stream, propagate raw lines to stdout
print(line, file=sys.stdout, end="")
# and force flush on stdout to make sure every line gets displayed
sys.stdout.buffer.write(line.encode("utf-8"))
sys.stdout.buffer.flush()

self._current_index += 1
headers, position = self.get_headers(line)
Expand Down

0 comments on commit 459cf20

Please sign in to comment.