pklaus / brother_ql

Python package for the raster language protocol of the Brother QL series label printers (QL-500, QL-550, QL-560, QL-570, QL-700, QL-710W, QL-720NW, QL-800, QL-810W, QL-820NWB, QL-1050, QL-1060N and more).
GNU General Public License v3.0
558 stars 165 forks source link

unsupported operand type(s) #9

Closed zookee1 closed 7 years ago

zookee1 commented 7 years ago

Hey, while creating the .bin-file I always get this message. It still work's but wanted to let you know that this occurs:

WARNING:brother_ql.brother_ql_create:Need to resize the image...
Traceback (most recent call last):
  File "/usr/local/bin/brother_ql_print", line 11, in <module>
    load_entry_point('brother-ql==0.6.dev0', 'console_scripts', 'brother_ql_print')()
  File "/usr/local/lib/python2.7/dist-packages/brother_ql/brother_ql_print.py", line 85, in main
    result = interpret_response(data)
  File "/usr/local/lib/python2.7/dist-packages/brother_ql/reader.py", line 157, in interpret_response
    if error_info_1 & (1 << error_bit):
TypeError: unsupported operand type(s) for &: 'str' and 'int'

Thanks a lot for the library!

Cheers

pklaus commented 7 years ago

The very first line in your console output is from the brother_ql_create tool. It's letting you know that it has to resize your picture, because you don't provide it with the ideal pixel dimensions right away. If you can, try to stick to the pixel dimensions that brother_ql_info list-label-sizes tells you.

The following lines in your output are from the tool brother_ql_print. Let me quote the print section of the README:

[...] tool brother_ql_print (Py3 only) [...]

It's just not Python 2 compatible. (Sending the data should work, but interpreting the response fails.) I'm surprised how many out there are still using Python 2. :) I'm currently not planning to make the tool Python 2 compatible but if there will be more issues coming in like this, I might consider porting it back.

Thanks again for the report and let me know if you can imagine any way to improve the library.