Posts: 26,215
Joined: Oct 2003
Reputation:
187
on win32, special://home is always the same as special://xbmc.
This is obviously not correct (as special://xbmc should not be presumed to be writable), but is something we haven't yet fixed.
Also: Note that for backward compatibility, translatePath() currently translates the old style paths as well as the new ones. Remember: Only use it if you are going to be hitting the filesystem for whatever reason.
Cheers,
Jonathan
Posts: 1,466
Joined: Jul 2005
Reputation:
29
Basje
Team-Kodi Member
Posts: 1,466
When I try to import a library I call:
sys.path.append('special://home/scripts/XOT-Uzg.v3/resources/libs/')
Then I call:
import envcontroller
And I get this error under Win32:
unable to get modification time from 'special://home/scripts/XOT-Uzg.v3/resources/libs/envcontroller.py'
If I use the xbmc.translatePath() method on the special://-path and then do sys.path.append everything goes fine.
What could be wrong?
Posts: 26,215
Joined: Oct 2003
Reputation:
187
Supply an example script please. Note that you probably shouldn't be assuming where your script location is.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
Fixed in r17694.
Cheers,
Jonathan
Posts: 901
Joined: Feb 2005
Reputation:
3
its probably because the special:// cmds haven't been back merged to xbox yet.
You need to put translatePath() around anything that uses os.
but, as translatePath() converts mappings to the new special:// equiv. I'd recommend sticking with Q: T: etc for now for wider platform compatibility.
BBB
Posts: 1,747
Joined: Jun 2004
Reputation:
12
blittan
Retired Team-Kodi Member
Posts: 1,747
2009-02-15, 01:42
(This post was last modified: 2009-02-15, 01:46 by blittan.)
@Basje: you need to do a os.remove(translatePath(_oldFileName)) for it to work.
as soon as you are accessing the filesystem with python itself and not using xbmc's functions, then you need to supply translatePath()
Posts: 901
Joined: Feb 2005
Reputation:
3
I think he's referring to the backwards compatibility translation done in the func, not the removal of the func itself.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
You shouldn't need any of those changes, and the special://profile/ change should certainly function (they're essentially identical). What version are you running? Do you even use different profiles?
And there's a reason it's not in CSpecialProtocol::LogPaths() - it's not setup at that point (the path is mapped in CSettings::LoadProfile()) which comes a bit further down.)
Cheers,
Jonathan