Open Nekmo opened 4 years ago
I had the same problem with a dhcp hostname, a single windows machine broke the entire solution. At the very least the use of ignore error should be implemented. I use:
def get_python_value(self, bytes):
for d in ['utf-8','latin1']:
try:
return bytes.decode(d)
except:
pass
return bytes.decode(encoding='utf-8', errors='ignore')
Added
errors='ignore'
toStringField
(avoid a exception due to encoding issues) and added environ variable for change the encoding to be used when connecting to the router.