On Mon, Sep 19, 2011 at 1:18 PM, Wander Lairson Costa wrote:
> 2011/9/17 Peter Bigot:
>> The following program causes a segfault using libusb-1.0:
>>
>>  import usb
>>  rf2500 = usb.core.find(idVendor=0x0451, idProduct=0xF432)
>>  cfg = rf2500.get_active_configuration()
>>
>> due to libusb_get_configuration being invoked with a null device
>> handle.  The fix is as below:

> Thanks for the patch, it has been applied to github repo:
>
> https://github.com/walac/pyusb/commit/68036163ba4f9f2eed73bf3189d7c332ebea1f77

BTW, this also fixes a segfault when any other operation (which
implicitly would call libusb_get_configuration) is done without
calling set_configuration first. An issue I just discovered when
modifying Joshua's example a few days ago, see code below.

Does it mean that http://pyusb.sourceforge.net/docs/1.0/tutorial.html
can be updated to not require the set_configuration request, or is
this not really valid usage and pyusb should rather be changed to
raise an error?

Thank you very much,
Tormod

import usb
dev = usb.core.find(idVendor=0xfffe, idProduct=0x0000)
#dev.set_configuration()
print dev.read(0x81, 20,0,100)

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to