diff --git a/CHANGELOG.md b/CHANGELOG.md index 7266be8a..81058edb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- +- Gracefully ignore UTF-8 decoding errors by [@XuehaiPan](https://github.com/XuehaiPan). ### Removed diff --git a/nvitop/api/device.py b/nvitop/api/device.py index f2578095..6b56693c 100644 --- a/nvitop/api/device.py +++ b/nvitop/api/device.py @@ -3146,7 +3146,7 @@ def _parse_cuda_visible_devices( # pylint: disable=too-many-branches,too-many-s ), ], ) - .decode('utf-8') + .decode('utf-8', errors='replace') .strip() .split(',') ) diff --git a/nvitop/api/libnvml.py b/nvitop/api/libnvml.py index fb176670..515ec5ad 100644 --- a/nvitop/api/libnvml.py +++ b/nvitop/api/libnvml.py @@ -461,7 +461,7 @@ def nvmlQuery( raise if isinstance(retval, bytes): - retval = retval.decode('utf-8') + retval = retval.decode('utf-8', errors='replace') return retval