From abcd62fd703838fe184ff60b959cb637fd6ccb47 Mon Sep 17 00:00:00 2001
From: Sven Robertz <sven@cs.lth.se>
Date: Fri, 22 Feb 2013 15:38:09 +0100
Subject: [PATCH] changed encoding in python

---
 lib/python/labcomm/LabComm.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/python/labcomm/LabComm.py b/lib/python/labcomm/LabComm.py
index e13f289..24a757c 100644
--- a/lib/python/labcomm/LabComm.py
+++ b/lib/python/labcomm/LabComm.py
@@ -588,7 +588,8 @@ class Encoder(Codec):
         self.encode_byte(tmp & 0x7f)
 
     def encode_type(self, index):
-        self.pack("!i", index)
+        self.encode_packed32(index)
+#        self.pack("!i", index)
             
     def encode_boolean(self, v):
         if v:
@@ -616,7 +617,9 @@ class Encoder(Codec):
 
     def encode_string(self, v):
         s = v.encode("utf8")
-        self.pack("!i%ds" % len(s), len(s), s)
+	self.encode_packed32(len(s));
+	self.pack("%ds" % len(s),s)
+#        self.pack("!i%ds" % len(s), len(s), s)
 
 class Decoder(Codec):
     def __init__(self, reader):
-- 
GitLab