Line 55 and following of amqplib/client_0_8/channel.py state that there is a "auto_decode" parameter for AMQP channels, which defaults to True. This will automatically decode incoming messages which have the "content_encoding" property set. Because of this fact, the "decode" method of carrot's built-in deserializer (line 141 of carrot/serialization.py) will receive an already decoded unicode object and tries to decode it again (line 160), which will work just fine if there are only ASCII characters but will crash if there are non-ASCII characters in the data (happened to me).
My suggestions:
Either instantiate the Channel object with "auto_decode=False" in carrot/backends/pyamqplib.py line 89 like this:
self.channel = Channel(self.connection.connection, auto_decode=False)
Or check if "data" already is an unicode object in carrot/serialization.py line 158-160 like that:
Don't decode 8-bit strings or unicode objects
if content_encoding not in ('binary', 'ascii-8bit') and not isinstance(data, unicode):
data = codecs.decode(data, content_encoding)
I would prefer the latter method and leave the decoding to pyamqplib.
Line 55 and following of amqplib/client_0_8/channel.py state that there is a "auto_decode" parameter for AMQP channels, which defaults to True. This will automatically decode incoming messages which have the "content_encoding" property set. Because of this fact, the "decode" method of carrot's built-in deserializer (line 141 of carrot/serialization.py) will receive an already decoded unicode object and tries to decode it again (line 160), which will work just fine if there are only ASCII characters but will crash if there are non-ASCII characters in the data (happened to me).
My suggestions: Either instantiate the Channel object with "auto_decode=False" in carrot/backends/pyamqplib.py line 89 like this: self.channel = Channel(self.connection.connection, auto_decode=False)
Or check if "data" already is an unicode object in carrot/serialization.py line 158-160 like that:
Don't decode 8-bit strings or unicode objects
I would prefer the latter method and leave the decoding to pyamqplib.