mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure connect to folder in USBMS ends with a trailing separator
Some third party plugins apparently do string concatenation on paths instead of using os.path.join
This commit is contained in:
parent
f7aeb7b490
commit
d2cd60f9e6
@ -763,6 +763,8 @@ class Device(DeviceConfig, DevicePlugin):
|
||||
raise DeviceError(f'The path {folder_path} is not a folder cannot connect to it')
|
||||
if not os.access(folder_path, os.R_OK | os.W_OK):
|
||||
raise DeviceError(f'You do not have permission to read and write to {folder_path} cannot connect to it')
|
||||
if not folder_path.endswith(os.sep) and not folder_path.endswith('/'):
|
||||
folder_path += os.sep
|
||||
self._main_prefix = folder_path
|
||||
self.current_library_uuid = library_uuid
|
||||
self.device_being_opened = connected_device
|
||||
|
Loading…
x
Reference in New Issue
Block a user