You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure what's the best suggested fix, but I imagine (at a very high level), it's to provide a means to propagate the binary config into symbol.c and then skip the PyUnicode_FromStringAndSize() call under those circumstances.
Beyond that, I'm not quite sure about the specifics yet. I've never extended Python with C before (though perhaps now is a good time to learn). To be fair, this is open source, so I should contribute a fix. But if you can provide guidance and/or code, then I'd be grateful please. Else, I'll try to learn how to do it and this issue shall be a notice for others.
The Python bindings of zbar doesn't support output in binary mode.
Reproduction steps
echo -ne '\x80\x91\xa2\xb3\xc4\xd5\xe6\xf7\x88\x99\xaa\xbb\xcc\xdd\xee\xff' > bin
Expected behaviour
It'll decode the QR code and then print out:
b'\x80\x91\xa2\xb3\xc4\xd5\xe6\xf7\x88\x99\xaa\xbb\xcc\xdd\xee\xff'
Observed Behavior
It'll throw an exception and print out:
Analysis
I suspect the issue is on this line where it forces the symbol data to be an Unicode string (latest commit as of this issue is a549566):
https://github.com/mchehab/zbar/blob/master/python/symbol.c#L105
I'm not sure what's the best suggested fix, but I imagine (at a very high level), it's to provide a means to propagate the
binary
config intosymbol.c
and then skip thePyUnicode_FromStringAndSize()
call under those circumstances.Beyond that, I'm not quite sure about the specifics yet. I've never extended Python with C before (though perhaps now is a good time to learn). To be fair, this is open source, so I should contribute a fix. But if you can provide guidance and/or code, then I'd be grateful please. Else, I'll try to learn how to do it and this issue shall be a notice for others.
Issue also related to #64 and #268
The text was updated successfully, but these errors were encountered: