robweber / xbmcbackup

Backup Addon for Kodi
MIT License
107 stars 48 forks source link

AttributeError: module 'xbmc' has no attribute 'validatePath' #166

Closed AnonTester closed 4 years ago

AnonTester commented 4 years ago

In latest Kodi 19, the validatePath function has been moved from xbmc to xbmcvfs resulting in an error.

See commit on 25/April/2020: https://github.com/xbmc/xbmc/commit/1b46f3413b1ea3ab96e6ddb895c185e29147305f

Error message Kodi (19.0-ALPHA1 Git:20200503-6e731c55b7). Platform: Linux x86 64-bit :

2020-05-03 15:54:16.905 T:13979   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: module 'xbmc' has no attribute 'validatePath'
                                                   Traceback (most recent call last):
                                                     File "/home/kodi/.kodi/addons/script.xbmcbackup/service.py", line 4, in <module>
                                                       BackupScheduler().start()
                                                     File "/home/kodi/.kodi/addons/script.xbmcbackup/resources/lib/scheduler.py", line 48, in __init__
                                                       self.doScheduledBackup(progress_mode)
                                                     File "/home/kodi/.kodi/addons/script.xbmcbackup/resources/lib/scheduler.py", line 109, in doScheduledBackup
                                                       backup.backup(False)
                                                     File "/home/kodi/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 137, in backup
                                                       allFiles.append(self._addBackupDir(aDir, selectedDirs[aDir]['root'], selectedDirs[aDir]['dirs']))
                                                     File "/home/kodi/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 431, in _addBackupDir
                                                       fileManager.walk()
                                                     File "/home/kodi/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 559, in walk
                                                       self.walkTree(xbmc.translatePath(aDir['path']), aDir['recurse'])
                                                     File "/home/kodi/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 574, in walkTree
                                                       dirPath = xbmc.validatePath(xbmc.translatePath(directory + self.pathSep + aDir))
                                                   AttributeError: module 'xbmc' has no attribute 'validatePath'
                                                   -->End of Python script error report<--

2020-05-03 15:54:17.797 T:13979    INFO <general>: Python interpreter stopped
AnonTester commented 4 years ago

This is with script.xbmcbackup v1.6.2 installed just for the record.

robweber commented 4 years ago

Do you have any reference (PR, etc) for this. According to the Python docs and the forum post regarding v19 API changes I don't see anything about moving that function. Haven't tested this myself yet but don't want to go down a rabbit hole for something I can't verify. Thanks.

AnonTester commented 4 years ago

you mean like the official commit I referenced above ? :)

robweber commented 4 years ago

Sorry - saw this via email and was focusing on the error. Yup exactly like that. Guess this was recent enough the docs didn't update just yet. Thanks for pointing this out. I'll have to get a nightly build and test it out.

AnonTester commented 4 years ago

yeah, quite recent. not all docs have been updated yet.