2012/3/28 Tormod Volden <lists.tor...@gmail.com>: > Hi, > There is one legacy compatibility issue which I find difficult to > solve. Maybe some python expert can come to the rescue. The > bulkWrite() function in usb/legacy.py says it can accept a buffer of > any sequence type. Indeed, with pyusb 0.4 I could use a sequence of > characters, like ['a', 'b', 'c']. This is currently broken. > bulkWrite() simply wraps write() which runs as_array() from > usb/_interop.py on the buffer, which as far as I can see accepts > sequence of bytes, strings, and via a TypeError exception, unicode > strings. One could maybe add another TypeError exception for character > sequence but I feel that will get ugly and there must be a better way. > The problem seems to have been introduced with the python3 support in > commit a5e3129dfcff7c06caa9894a406224f8a05b35c7. >
Yes, this is a known problem that was already reported before. PyUSB 0.4 was very flexible in managing the buffer types, and PyUSB 1.0 is not that so. I could not find yet a simple and elegant solution for this problem, but try to mimic to behavior of the C version of PyUSB. -- Best Regards, Wander Lairson Costa ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users