2011/9/17 Peter Bigot <pabi...@users.sourceforge.net>:
> 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:
>
> diff --git a/usb/core.py b/usb/core.py
> index a6231c4..1a5288c 100644
> --- a/usb/core.py
> +++ b/usb/core.py
> @@ -160,6 +160,7 @@ class _ResourceManager(object):
>
>    def get_active_configuration(self, device):
>        if self._active_cfg_index is None:
> +            self.managed_open()
>            cfg = util.find_descriptor(
>                    device,
>
> bConfigurationValue=self.backend.get_configuration(self.handle)
> --
> 1.7.6
>

Thanks for the patch, it has been applied to github repo:

https://github.com/walac/pyusb/commit/68036163ba4f9f2eed73bf3189d7c332ebea1f77

-- 
Best Regards,
Wander Lairson Costa

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to