Kodi Community Forum
Some scripts cause path related cmds to - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Some scripts cause path related cmds to (/showthread.php?tid=18798)



- triggernum5 - 2006-03-14

i've seen this before, but i've been working with xrss python script, and it does it.. eg.
Quote: try:
uri = items[position].getelement("link")
txttitle = items[position].getelement("title")
txttitle = txttitle[:37]+'.txt'
try:
print txttitle
print 'f:\\txt\\' + txttitle
txtjointest = path.join("f:\\txt\\", txttitle)
print txtjointest
except:
print 'bad join'
try:
urllib.urlretrieve(uri, 'f:\\txt\\temp.txt')
print 'dled'
os.rename('f:\\txt\\temp.txt', 'f:\\txt\\'+txttitle)
print 'rned'
except:
print 'save error'
pathfile = open('f:\\txt\\currenttxt.link','w')
pathfile.write(uri)
pathfile.close()

this is an excerpt that should make it obvious what i've been struggling with.. i can urlretrieve/rename/join etc files as long as i manually enter a name, not if there are any variables.. it always fails in certain scripts with variables.. as a last ditch effort, i guess i can write details to pathfile, and execute a miniscript since the exact same code works in other scripts with the exact same imports.. btw, this is the same from a fresh reboot, to after many libraries have been loaded by several scripts.. anybody know whats going on?