Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix Version: "xbmc" has no attribute "translatepath" #442

Open
ISharkI opened this issue Aug 1, 2021 · 2 comments
Open

Matrix Version: "xbmc" has no attribute "translatepath" #442

ISharkI opened this issue Aug 1, 2021 · 2 comments

Comments

@ISharkI
Copy link

ISharkI commented Aug 1, 2021

Hi,
not sure if thats a real bug or just something happening on my setup but I thought it may be worth sharing it.
When I tried starting the RCB with my current Matrix Kodi (20.0-ALPHA1 (19.90.101) Git:20210725-58e75a75f8) running on Ubuntu Focal (LTS) I got the following error:

Error Type: <class 'AttributeError'>
Error Contents: module 'xbmc' has no attribute 'translatePath'
Traceback (most recent call last):
  File "/home/kodi/.kodi/addons/plugin.games.rom.collection.browser.widget/default.py", line 18, in <module>
    widget.Widget().runPlugin()
  File "/home/kodi/.kodi/addons/plugin.games.rom.collection.browser.widget/resources/lib/widget.py", line 64, in runPlugin
    gdb = self.openDbConnection()
  File "/home/kodi/.kodi/addons/plugin.games.rom.collection.browser.widget/resources/lib/widget.py", line 212, in openDbConnection
    gdb = GameDataBase(util.getAddonDataPath())
  File "/home/kodi/.kodi/addons/script.games.rom.collection.browser/resources/lib/util.py", line 209, in getAddonDataPath
    path = convertToUnicodeString(xbmc.translatePath('special://profile/addon_data/%s' % (SCRIPTID)))
AttributeError: module 'xbmc' has no attribute 'translatePath'
-->End of Python script error report<--

I remembered having a similar problem before and changed in the util.py in line 209 from
path = convertToUnicodeString(xbmc.translatePath('special://profile/addon_data/%s' % (SCRIPTID)))
to
path = convertToUnicodeString(xbmcvfs.translatePath('special://profile/addon_data/%s' % (SCRIPTID)))
The xbmc virtual file system documentation at least said it had a "translatepath" function and I gave it a shot. Not sure if I made it batter or worse now butit worked. I just tested several games and it seems to work.

Maybe it's a fluke, maybe it's a solution - Would be nice if somebody could verify this if the same error is stumbled upon?

@Killom
Copy link

Killom commented Dec 12, 2021

Can confirm this issue. Same here on LE 11 nightly-20211212-7ed4d18 / (20.0-ALPHA1 (19.90.101) Git 20211212

Can also confirm above fix suggested by @ISharkI. Is "xbmc.translatePath" deprecated?

@Killom
Copy link

Killom commented Dec 29, 2021

Just recently seen in kodi.log:

2021-12-29 17:19:23.037 T:1489 WARNING <general>: xbmc.translatePath is deprecated and might be removed in future kodi versions. Please use xbmcvfs.translatePath instead.

There is a merged PR, which should fix this. But somehow it is still missing in recent version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants