Closed l0ud closed 7 years ago
Hello.
Could you paste the traceback (only with the lines in python-libusb1, which should contain the error) ?
If the error is TypeError: 'float' object cannot be interpreted as an integer
I can guess where it comes from (int / int becomes float, and range does not like floats) and hence how to fix it (int // int stays int).
But the error you report seems to be a different one, so I'm not sure if that is the right bug.
It's exactly the error you mentioned. I wrote that from memory so it could be misleading, sorry about that.
To be honest, I didn't know about floordiv operator in Python! It's much more readable than the byte shift, so I can only agree to fix it that way. Thanks!
This should be fixed as of 0428e7e6972b3681219fcb3c8e41219915f632de .
Thanks to this bug I also realised this method accidentally returned ctype objects, which was not intended. I think they should behave like regular integers, so I'm not too worried about breaking compatibility (...and I must admit I did not actually expect this method to be really used, as I think multi-language devices are rare - but I may be mistaken on the actual uses of this part of the USB specs).
Thanks for confirming the fix. Released on pypi as 1.5.1 .
Hi. I just encountered a small issue in your library. In getSupportedLanguageList, this line gives error about incompatible types (int and float):
for offset in xrange(1, length / 2):
Using binary shift instead, should solve this problem:
for offset in xrange(1, length >> 1):