Closed Araneidae closed 4 years ago
There are two issues here:
UnicodeDecodeError
occurs during a ctypes
wrapped callback, and so is not reported to the caller, hence the second Timedout
exception. This is straightforward to fix.One option is to use decode('UTF-8', 'ignore')
or decode('UTF-8', 'replace')
, but this would disguise errors that perhaps should be treated as exceptions.
@willrogers , @thomascobb , I'm interested in your thoughts on this.
I've implemented decode('UTF-8', 'replace')
in commit 17920a457c83f8e11fa0ded605e0712fcbbccd54 which fixes this.
This seems like a reasonable solution to me.
Calling
caget
on Python3 on a PV which returns a string which is not in UTF-8 format triggers an exception which is not reported to the caller. For example: