Skip to content

Commit eff8648

Browse files
authored
replace invalid UTF-8 characters with � when decoding HDF5 attrs (#558)
1 parent a619238 commit eff8648

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kerchunk/hdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def _transfer_attrs(
186186

187187
# Fix some attribute values to avoid JSON encoding exceptions...
188188
if isinstance(v, bytes):
189-
v = v.decode("utf-8") or " "
189+
v = v.decode("utf-8", errors="replace") or " "
190190
elif isinstance(v, (np.ndarray, np.number, np.bool_)):
191191
if v.dtype.kind == "S":
192192
v = v.astype(str)

0 commit comments

Comments
 (0)