apmorton / pyhidapi

hidapi bindings in ctypes
MIT License
112 stars 42 forks source link

Python 2 TypeError: one character string expected #46

Closed anton-dos closed 2 years ago

anton-dos commented 3 years ago

Erorr in 'get_feature_report' function: data[0] = bytearray((report_id,))

struct.pack('B', report_id) instead bytearray((report_id,)) is a suitable solution for both python versions

elfmimi commented 2 years ago

P-R https://github.com/apmorton/pyhidapi/pull/43 is addressing the same issue.

apmorton commented 2 years ago

https://www.python.org/doc/sunset-python-2/