Skip to content

Commit

Permalink
allow non-utf-8 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
jpihl committed Aug 28, 2023
1 parent 2666f02 commit 2b0dd3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ every change, see the Git log.

Latest
------
* tbd
* Patch: Allow processes to output non-UTF-8 characters to stdout and stderr by
replacing with '?'.

2.4.0
-----
Expand Down
2 changes: 1 addition & 1 deletion src/dummynet/process_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def read_fd(self, fd):
self.log.debug(f"Poller: read {len(data)} bytes from fd {fd}")

# Call the callback
self.fds[fd](data.decode("utf-8"))
self.fds[fd](data.decode(encoding="utf-8", errors="replace"))

def poll(self, timeout):
fds = self.poller.poll(timeout)
Expand Down

0 comments on commit 2b0dd3b

Please sign in to comment.