--- a/pygpibtoolkit/gpib_utils.py Tue May 01 00:10:23 2018 +0200 +++ b/pygpibtoolkit/gpib_utils.py Fri May 04 01:00:59 2018 +0200 @@ -52,11 +52,9 @@ """ nb = s[0] s = s[1:nb+2] - r = [] - # XXX why do we need to do this? It's not described in the manual... - for c in s: - r.append(chr(c & 0x7F)) - return ''.join(r) + assert s[-1] == 0 + s = s[:-1] + return ''.join(chr(c & 0x7F) for c in s) ###