mirror of
https://opendev.org/x/pyghmi
synced 2025-01-14 03:37:47 +00:00
Allow LookupError on decode
If a minimal Python distro does not have obscure decodes, do not cause a problem. t review Change-Id: Ife9631c353ca5b8160019eb26d0fe781a5c2179f
This commit is contained in:
parent
42b6807840
commit
d77d0a1904
@ -229,12 +229,12 @@ class FRU(object):
|
||||
if lang in (0, 25):
|
||||
try:
|
||||
retinfo = retinfo.decode('iso-8859-1')
|
||||
except UnicodeDecodeError:
|
||||
except (UnicodeError, LookupError):
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
retinfo = retinfo.decode('utf-16le')
|
||||
except UnicodeDecodeError:
|
||||
except (UnicodeDecodeError, LookupError):
|
||||
pass
|
||||
# Some things lie about being text. Do the best we can by
|
||||
# removing trailing spaces and nulls like makes sense for text
|
||||
|
Loading…
x
Reference in New Issue
Block a user