Skip to content

Commit

Permalink
Fix a bug when logging invalid UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTG committed Jun 2, 2024
1 parent 7f82527 commit c35a7a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
> breaking changes may be introduced
> at any time without warning.
## [Unreleased]

### Fixed

- Fixed a bug where logging invalid UTF-8 characters in `UnformattedLogDriver` would raise an exception.

## [0.1.2] - 2024-05-31

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/libretro/drivers/log/unformatted.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def records(self) -> Sequence[LogRecord]:
return self._records

def log(self, level: LogLevel, fmt: bytes, *args) -> None:
self._logger.log(level.logging_level, fmt.decode().rstrip())
self._logger.log(level.logging_level, fmt.decode(errors="replace").rstrip())


__all__ = ["UnformattedLogDriver"]

0 comments on commit c35a7a0

Please sign in to comment.