[ 
https://issues.apache.org/jira/browse/PROTON-2531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17921810#comment-17921810
 ] 

Andrew Stitcher commented on PROTON-2531:
-----------------------------------------

I think that the conversion from python2 to python3 has caused this issue. 
Together with the change from SWIG to cffi.

In python2 there is no distinction between the bytes type and the str type but 
unicode is a different type:
python2: {{'a'==b'a'!=u'a'}} 
python3: {{'a'==u'a'!=b'a'}}

So is this 0.38 code using python3? If so, I agree that what SWIG is doing is 
opaque and perplexing! Especially as this isa just not a valid unicode str. If 
using python2 then that's just what you'd expect!

The exception is coming from the the new cffi code which turns the incoming 
bytes tag into a valid unicode string, however of course it's not valid utf8.

> Delivery tag is str while it should be bytes
> --------------------------------------------
>
>                 Key: PROTON-2531
>                 URL: https://issues.apache.org/jira/browse/PROTON-2531
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: python-binding
>            Reporter: Ievgen Popovych
>            Priority: Major
>
> According to AMQP standard delivery tag is ??up to 32 octets of binary 
> data??. Proton C library also has it in binary format.
> But in the Python binding {{Delivery.tag}} is a string, which causes issues 
> when trying to use it (i.e. print/visualize).
> As far as I understand this is down to Swig {{python/cproton.i}} 
> {{wrap_pn_delivery_tag}} (since typemap for {{pn_delivery_tag_t}} seems to be 
> correct)?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to