Posts: 3,456
Joined: Jan 2011
Reputation:
364
pkscout
Team-Kodi Member
Posts: 3,456
A debug log would be helpful. I use xbmcvfs.delete() in Artist Slideshow, and it's working fine in Gotham.
Posts: 17,859
Joined: Jul 2011
Reputation:
371
looks already wrong from the log message. no way that's gonna work like that
Posts: 18
Joined: May 2014
Reputation:
0
2014-05-14, 11:28
(This post was last modified: 2014-05-14, 11:57 by yosubis.)
What seems wrong? The dashes are not part of the original log, I placed them in the post (I'm a wee bit paranoid).
I don't think the double slash are the cause since it is just a representation of a slash.
Edit: Also, I know for a fact that the file exists. When I copy the file path that is reported as non existent and paste it in a run window, it opens the correct file.
Posts: 18
Joined: May 2014
Reputation:
0
Can anyone enlighten me as to what I'm doing wrong?
Posts: 2,368
Joined: Mar 2010
Reputation:
60
giftie
Skilled Python Coder
Posts: 2,368
I believe you need to get rid of the double backslashes and change them to single backslash... You Might try changing them to forward slashes(single)
Posts: 3,456
Joined: Jan 2011
Reputation:
364
pkscout
Team-Kodi Member
Posts: 3,456
2014-05-18, 10:31
(This post was last modified: 2014-05-18, 10:32 by pkscout.)
If you built the path by joining strings, that might be the problem. You might try using os.path.join. It would be really helpful to see more than two lines of code out of context and a little snippet of the log.
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
I'm no python expert, I'll be the first to admit, but the only line that stands out to me is
(2014-06-03, 10:24)yosubis Wrote: user_file = os.path.join(ADDON_DATA['profile_dir'], USER_FILE_NAME)
As someone quite happy to admit they don't get the whole encode/decode utf-8 thing, even after reading lots of docs, I thought that would have to be:
Code:
user_file = os.path.join(ADDON_DATA['profile_dir'].encode('utf-8'), USER_FILE_NAME).decode('utf-8')
I'm going to assume that won't help, though, so will simply say - the error is quite clear: the file isn't found. That basically leaves you with two possibilities: either the file isn't where you think it is, or the path you're passing to xbmcvfs.delete isn't correct.
Posts: 18
Joined: May 2014
Reputation:
0
Ok, it seems I found the problem. I put "time.sleep(2)" after "os.remove(file_to_delete)" and then everything worked.