2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-28 03:48:09 +00:00

Treat thorn as string terminating

While a thorn in theory could be valid,
in practice the more likely intention
is yet another nonstandard string termination
attempt.

Change-Id: I71f837725b1e286b9f94786aa520deb12ce208e4
This commit is contained in:
Jarrod Johnson 2019-02-20 13:36:17 -05:00
parent 57d4db40ca
commit d065f22324

View File

@ -225,7 +225,9 @@ class FRU(object):
# strictly speaking, \xff should be a y with diaeresis, but
# erring on the side of that not being very relevant in practice
# to fru info, particularly the last values
retinfo = retinfo.rstrip('\xff\x00 ')
# Additionally 0xfe has been observed, which should be a thorn, but
# again assuming termination of string is more likely than thorn.
retinfo = retinfo.rstrip('\xfe\xff\x00 ')
if lang in (0, 25):
try:
retinfo = retinfo.decode('iso-8859-1')