From 355405784da3a38fe955f1aff4074d38a554670e Mon Sep 17 00:00:00 2001 From: pcain-usgs <pcain@usgs.gov> Date: Tue, 2 Jul 2019 15:14:13 -0600 Subject: [PATCH] Fixes issue 226 Modifies the pack string so that it's a bytes object rather than a string. --- geomagio/edge/RawInputClient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/geomagio/edge/RawInputClient.py b/geomagio/edge/RawInputClient.py index 5bcb7d721..eeea3889b 100644 --- a/geomagio/edge/RawInputClient.py +++ b/geomagio/edge/RawInputClient.py @@ -321,7 +321,8 @@ class RawInputClient(): ratemantissa, ratedivisor = self._get_mantissa_divisor(rate) packStr = '%s%d%s' % (PACKSTR, nsamp, 'i') - buf = struct.pack(packStr, PACKETHEAD, nsamp, self.seedname, yr, doy, + bpackStr = str.encode(packStr) + buf = struct.pack(bpackStr, PACKETHEAD, nsamp, self.seedname, yr, doy, ratemantissa, ratedivisor, self.activity, self.ioclock, self.quality, self.timingquality, secs, usecs, self.sequence, *samples) -- GitLab