arvydas / blinkstick-python

BlinkStick Python interface to control devices connected to the computer
Other
136 stars 53 forks source link

Possible Windows 10 c_ubyte issue #64

Open towlerj opened 4 years ago

towlerj commented 4 years ago

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.

mjsr commented 4 years ago

Could reproduce on Windows 10 with Python 3.6.4.