From 84ae7feb3a660f7fd02badc7453c6d3078b2fc8b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 22 May 2006 14:27:06 -0400 Subject: [PATCH] String-ify data before trying to pack it into the struct. --- sugar/p2p/MostlyReliablePipe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sugar/p2p/MostlyReliablePipe.py b/sugar/p2p/MostlyReliablePipe.py index e6ba3429..f63a8b1b 100644 --- a/sugar/p2p/MostlyReliablePipe.py +++ b/sugar/p2p/MostlyReliablePipe.py @@ -679,8 +679,8 @@ class MostlyReliablePipe(object): msg_seq = self._next_msg_seq() # Pack the data into network byte order - template = "! %ds" % len(data) - data = struct.pack(template, data) + template = "! %ds" % len(str(data)) + data = struct.pack(template, str(data)) master_sha = _sha_data(data) # Split up the data into segments