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:
Kovid Goyal 2025-03-07 07:53:32 +05:30
parent f7aeb7b490
commit d2cd60f9e6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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