Skip to content

Commit

Permalink
Merge pull request #10 from ecmwf/bug/unicode-decode-error
Browse files Browse the repository at this point in the history
More permissive utf-8 decoding for error strings from the C++ side.
  • Loading branch information
tbkr authored Oct 10, 2024
2 parents 834609b + bb6b928 commit f0686ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyfdb/pyfdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def wrapped_fn(*args, **kwargs):
retval = fn(*args, **kwargs)
if retval != self.__lib.FDB_SUCCESS and retval != self.__lib.FDB_ITERATION_COMPLETE:
error_str = "Error in function {}: {}".format(
name, ffi.string(self.__lib.fdb_error_string(retval)).decode()
name, ffi.string(self.__lib.fdb_error_string(retval)).decode("utf-8", "backslashreplace")
)
raise FDBException(error_str)
return retval
Expand Down

0 comments on commit f0686ad

Please sign in to comment.