mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Explicitly disable MTP on windows XP, since some devices causes errors. See #1054273
This commit is contained in:
parent
5c425b2335
commit
647aed399a
@ -13,7 +13,7 @@ from future_builtins import zip
|
|||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
|
||||||
from calibre import as_unicode, prints
|
from calibre import as_unicode, prints
|
||||||
from calibre.constants import plugins, __appname__, numeric_version
|
from calibre.constants import plugins, __appname__, numeric_version, isxp
|
||||||
from calibre.ptempfile import SpooledTemporaryFile
|
from calibre.ptempfile import SpooledTemporaryFile
|
||||||
from calibre.devices.errors import OpenFailed, DeviceError, BlacklistedDevice
|
from calibre.devices.errors import OpenFailed, DeviceError, BlacklistedDevice
|
||||||
from calibre.devices.mtp.base import MTPDeviceBase, debug
|
from calibre.devices.mtp.base import MTPDeviceBase, debug
|
||||||
@ -55,7 +55,11 @@ class MTP_DEVICE(MTPDeviceBase):
|
|||||||
|
|
||||||
def startup(self):
|
def startup(self):
|
||||||
self.start_thread = threading.current_thread()
|
self.start_thread = threading.current_thread()
|
||||||
self.wpd, self.wpd_error = plugins['wpd']
|
if isxp:
|
||||||
|
self.wpd = None
|
||||||
|
self.wpd_error = _('MTP devices are not supported on Windows XP')
|
||||||
|
else:
|
||||||
|
self.wpd, self.wpd_error = plugins['wpd']
|
||||||
if self.wpd is not None:
|
if self.wpd is not None:
|
||||||
try:
|
try:
|
||||||
self.wpd.init(__appname__, *(numeric_version[:3]))
|
self.wpd.init(__appname__, *(numeric_version[:3]))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user