fix(api/libnvml): gracefully ignore UTF-8 decoding errors

This commit is contained in:
Xuehai Pan 2024-07-04 16:40:30 +08:00
parent 4f46184441
commit 6bc8a8bf10
3 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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(',')
)

View file

@ -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