Collectd network protocol implementation.
"""
-import socket,struct,sys
+import socket,struct
import platform
if platform.python_version() < '2.8.0':
# Python 2.7 and below io.StringIO does not like unicode
assert double.size == number.size
result = []
- for dstype in buf[header.size+short.size:off]:
+ for dstype in [ord(x) for x in buf[header.size+short.size:off]]:
if dstype == DS_TYPE_COUNTER:
result.append((dstype, number.unpack_from(buf, off)[0]))
off += valskip