2011/9/26 Tormod Volden <lists.tor...@gmail.com>: > 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? >
An error will be raised if the device is in a non configured state. -- Best Regards, Wander Lairson Costa https://github.com/walac https://gitorious.org/~walac ------------------------------------------------------------------------------ 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