I have this code:
... msgdict = {'datafile': datafile, 'mapper': mapper, 'reducer':reducer} msg = cPickle.dumps(msgdict) print msg
Print message msg I get this:
(dp1 S'mapper' p2 (S's3n://myFolder/mapper.py' p3 tp4 sS'datafile' p5 (S's3n://myFolder/test.txt' p6 tp7 sS'reducer' p8 (S's3n://myFolder/reducer.py' p9 tp10 s.
Then Im trying to get my content:
for i in range(count): m = q[0].read()
But I have this message:
msg = cPickle.loads(m.get_body()) TypeError: must be string, not unicode
Does anyone know how to solve this error?
Userx source share