blinkstick-python icon indicating copy to clipboard operation
blinkstick-python copied to clipboard

Possible Windows 10 c_ubyte issue

Open towlerj opened this issue 4 years ago • 1 comments

On Windows 10 I had problems with an ord() command.

It appears that the problem command was line 234 in blinkstick.py: data = (c_ubyte * len(data_or_wLength))(*[c_ubyte(ord(c)) for c in data_or_wLength])

I changed this to:

try:
    data = (c_ubyte * len(data_or_wLength))(*[c_ubyte(ord(c)) for c in data_or_wLength])
except:
    data = (c_ubyte * len(data_or_wLength))(*[c_ubyte(c) for c in data_or_wLength])

which appeared to resolve the issue.

I had assumed it was a Python 3 issue, so logged out of Windows and in to another system to go through updating, but on Linux (Ubuntu 19.10) and python 3.7.4 I don't have the same issue.

next time I'm logged in to that Win10 box I'll check the python version.

towlerj avatar May 08 '20 08:05 towlerj

Could reproduce on Windows 10 with Python 3.6.4.

mjsr avatar Sep 12 '20 05:09 mjsr