diff --git a/src/calibre/devices/mtp/unix/driver.py b/src/calibre/devices/mtp/unix/driver.py index 338913114f..2f215f6353 100644 --- a/src/calibre/devices/mtp/unix/driver.py +++ b/src/calibre/devices/mtp/unix/driver.py @@ -27,7 +27,8 @@ def fingerprint(d): class MTP_DEVICE(MTPDeviceBase): - supported_platforms = ['linux', 'osx'] + # libusb(x) does not work on OS X. So no MTP support for OS X + supported_platforms = ['linux'] def __init__(self, *args, **kwargs): MTPDeviceBase.__init__(self, *args, **kwargs) diff --git a/src/calibre/devices/scanner.py b/src/calibre/devices/scanner.py index 6865546a54..e0bb74fa2a 100644 --- a/src/calibre/devices/scanner.py +++ b/src/calibre/devices/scanner.py @@ -292,7 +292,15 @@ if islinux: libusb_scanner = LibUSBScanner() if isosx: - osx_scanner = libusb_scanner + # Apparently libusb causes mem leaks on some Macs and hangs on others and + # works on a few. OS X users will just have to live without MTP support. + # See https://bugs.launchpad.net/calibre/+bug/1044706 + # See https://bugs.launchpad.net/calibre/+bug/1044758 + # osx_scanner = libusb_scanner + usbobserver, usbobserver_err = plugins['usbobserver'] + if usbobserver is None: + raise RuntimeError('Failed to load usbobserver: %s'%usbobserver_err) + osx_scanner = usbobserver.get_usb_devices if isfreebsd: freebsd_scanner = FreeBSDScanner()