Skip to content

Commit

Permalink
fix(api/libnvml): gracefully ignore UTF-8 decoding errors
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Jul 4, 2024
1 parent 4f46184 commit 6bc8a8b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion nvitop/api/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(',')
)
Expand Down
2 changes: 1 addition & 1 deletion nvitop/api/libnvml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 6bc8a8b

Please sign in to comment.