mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
macOS: Fix a regression that broke connecting to devices
This commit is contained in:
parent
99680529d3
commit
ea2b8922cc
@ -114,7 +114,7 @@ def debug(ioreg_to_tmp=False, buf=None, plugins=None,
|
|||||||
drives = pprint.pformat(Device.osx_get_usb_drives())
|
drives = pprint.pformat(Device.osx_get_usb_drives())
|
||||||
ioreg = 'Output from mount:\n'+mount+'\n\n'
|
ioreg = 'Output from mount:\n'+mount+'\n\n'
|
||||||
ioreg += 'Output from osx_get_usb_drives:\n'+drives+'\n\n'
|
ioreg += 'Output from osx_get_usb_drives:\n'+drives+'\n\n'
|
||||||
ioreg += Device.run_ioreg()
|
ioreg += Device.run_ioreg().decode('utf-8')
|
||||||
connected_devices = []
|
connected_devices = []
|
||||||
if disabled_plugins:
|
if disabled_plugins:
|
||||||
out('\nDisabled plugins:', textwrap.fill(' '.join([x.__class__.__name__ for x in
|
out('\nDisabled plugins:', textwrap.fill(' '.join([x.__class__.__name__ for x in
|
||||||
@ -180,7 +180,7 @@ def debug(ioreg_to_tmp=False, buf=None, plugins=None,
|
|||||||
ioreg = 'IOREG Output\n'+ioreg
|
ioreg = 'IOREG Output\n'+ioreg
|
||||||
out(' ')
|
out(' ')
|
||||||
if ioreg_to_tmp:
|
if ioreg_to_tmp:
|
||||||
lopen('/tmp/ioreg.txt', 'wb').write(ioreg)
|
lopen('/tmp/ioreg.txt', 'w').write(ioreg)
|
||||||
out('Dont forget to send the contents of /tmp/ioreg.txt')
|
out('Dont forget to send the contents of /tmp/ioreg.txt')
|
||||||
out('You can open it with the command: open /tmp/ioreg.txt')
|
out('You can open it with the command: open /tmp/ioreg.txt')
|
||||||
else:
|
else:
|
||||||
|
@ -280,7 +280,7 @@ usbobserver_get_mounted_filesystems(PyObject *self, PyObject *args) {
|
|||||||
if (ans == NULL) { goto end; }
|
if (ans == NULL) { goto end; }
|
||||||
|
|
||||||
for (i = 0 ; i < num; i++) {
|
for (i = 0 ; i < num; i++) {
|
||||||
val = PyBytes_FromString(buf[i].f_mntonname);
|
val = PyUnicode_FromString(buf[i].f_mntonname);
|
||||||
if (!val) { NUKE(ans); goto end; }
|
if (!val) { NUKE(ans); goto end; }
|
||||||
if (PyDict_SetItemString(ans, buf[i].f_mntfromname, val) != 0) { NUKE(ans); NUKE(val); goto end; }
|
if (PyDict_SetItemString(ans, buf[i].f_mntfromname, val) != 0) { NUKE(ans); NUKE(val); goto end; }
|
||||||
NUKE(val);
|
NUKE(val);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user