From d77d0a190439258d4a4efa48deeb3985aa14a49c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Sun, 26 Feb 2017 13:25:38 -0500 Subject: [PATCH] Allow LookupError on decode If a minimal Python distro does not have obscure decodes, do not cause a problem. t review Change-Id: Ife9631c353ca5b8160019eb26d0fe781a5c2179f --- pyghmi/ipmi/fru.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/fru.py b/pyghmi/ipmi/fru.py index f6ae6d52..cbf2d8ca 100644 --- a/pyghmi/ipmi/fru.py +++ b/pyghmi/ipmi/fru.py @@ -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