[rabbitmq-discuss] Weird unicode error popping up in pika 0.9.6
Stephen Young
stephen.t.young at gmail.com
Mon Aug 13 16:22:17 BST 2012
Update: was because my queue name and routing key were unicode strings -
pulled the latest commit to pika which now checks for that, helped me
debug. Looks like everything has to be a bytestring in order for the
_marshal function to generate a valid payload, otherwise python tries to
encode everything into unicode
On Monday, August 13, 2012 9:40:53 AM UTC-4, Stephen Young wrote:
>
> Hi there,
>
> I've been using version 0.9,6 pika in a stable environment for about a
> month and am suddenly encountering a unicode error that looks like:
>
> Traceback (most recent call last):
> File
> "/devel/lib/python2.7/site-packages/Twisted-12.0.0-py2.7-macosx-10.7-x86_64.egg/twisted/internet/selectreactor.py",
> line 150, in _doReadOrWrite
> why = getattr(selectable, method)()
> File
> "/devel/lib/python2.7/site-packages/Twisted-12.0.0-py2.7-macosx-10.7-x86_64.egg/twisted/internet/tcp.py",
> line 199, in doRead
> rval = self.protocol.dataReceived(data)
> File "/devel/src/pika/pika/adapters/twisted_connection.py", line 378, in
> dataReceived
> self._on_data_available(data)
> File "/devel/src/pika/pika/connection.py", line 701, in
> _on_data_available
> frame) # Args
> File "/devel/src/pika/pika/callback.py", line 161, in process
> callback(*args, **keywords)
> File "/devel/src/pika/pika/channel.py", line 152, in
> _on_synchronous_complete
> self.rpc(*method)
> File "/devel/src/pika/pika/channel.py", line 114, in rpc
> self.send_method(method)
> File "/devel/src/pika/pika/channel.py", line 121, in send_method
> self.connection._send_method(self.channel_number, method, content)
> File "/devel/src/pika/pika/connection.py", line 781, in _send_method
> self._send_frame(pika.frame.Method(channel_number, method))
> File "/devel/src/pika/pika/adapters/twisted_connection.py", line 355, in
> _send_frame
> marshalled_frame = frame.marshal()
> File "/devel/src/pika/pika/frame.py", line 65, in marshal
> return self._marshal(pieces)
> File "/devel/src/pika/pika/frame.py", line 40, in _marshal
> len(payload)) + payload + chr(spec.FRAME_END)
> exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in
> position 0: ordinal not in range(128)
>
>
> I'm using the twisted adapter, and I have a hunch that the problem is
> coming from there somewhere, but I'm pretty lost as far as what to do to
> fix this bug. Anyone have any ideas?
>
> Cheers,
> Stephen
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120813/b5fbba8b/attachment.htm>
More information about the rabbitmq-discuss
mailing list