From 2a7d6f3662429a82e659e4088a309a8bbe57da14 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 20 Oct 2015 13:25:27 -0400 Subject: [PATCH] Fix chunk length when unicode on MCI Unicode data probably won't work, but to the extent it could work, it would be incorrect to do length on the unicode rather than length of the utf-8 encoded data. Change-Id: Id39484abff603fdaab421f3395063b17edd3ae15 --- pyghmi/ipmi/command.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index f43e0e1a..2ee1045b 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -1011,8 +1011,9 @@ class Command(object): chunks = [data[i:i+15] for i in xrange(0, len(data), 15)] offset = 0 for chunk in chunks: + chunk = bytearray(chunk, 'utf-8') cmddata = bytearray((0xdc, offset, len(chunk))) - cmddata += bytearray(chunk, 'utf-8') + cmddata += chunk self.xraw_command(netfn=0x2c, command=command, data=cmddata) def set_channel_access(self, channel=None,