Skip to content

Commit 1e860c5

Browse files
Fix decode error when parsing EEPROM fields (sonic-net#199)
#### Description Following error is seen while parsing EEPROM fields for few transceivers. 'utf-8' codec can't decode byte 0xff in position 6: invalid start byte #### Motivation and Context EEPROM fields will not be displayed if unicode characters are not properly. E.g. Vendor Date: 20'u-tf--8'
1 parent 93641f3 commit 1e860c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sonic_platform_base/sonic_sfp/sffbase.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def convert_hex_to_string(self, arr, start, end):
3535
ret_str = ''
3636
for n in range(start, end):
3737
ret_str += arr[n]
38-
return binascii.unhexlify(ret_str).decode("utf-8").strip()
38+
return binascii.unhexlify(ret_str).decode("utf-8", "ignore").strip()
3939
except Exception as err:
4040
return str(err)
4141

0 commit comments

Comments
 (0)