diff --git a/src/calibre/devices/__init__.py b/src/calibre/devices/__init__.py index c580923a21..b7cd66642e 100644 --- a/src/calibre/devices/__init__.py +++ b/src/calibre/devices/__init__.py @@ -113,7 +113,7 @@ def debug(ioreg_to_tmp=False, buf=None, plugins=None, ioreg = None if ismacos: from calibre.devices.usbms.device import Device - mount = '\n'.join(repr(x) for x in Device.osx_run_mount().splitlines()) + mount = Device.osx_run_mount() drives = pprint.pformat(Device.osx_get_usb_drives()) ioreg = 'Output from mount:\n'+mount+'\n\n' ioreg += 'Output from osx_get_usb_drives:\n'+drives+'\n\n' diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 357f8fe9bb..7622baa975 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -347,8 +347,7 @@ class Device(DeviceConfig, DevicePlugin): def osx_run_mount(cls): for i in range(3): try: - return subprocess.Popen('mount', - stdout=subprocess.PIPE).communicate()[0] + return subprocess.Popen('mount', stdout=subprocess.PIPE).communicate()[0].decode('utf-8', 'replace') except OSError: # Probably an interrupted system call if i == 2: raise