Kodi Community Forum
Bug Kodi does`nt delete the temp folder - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Subtitle Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=143)
+---- Thread: Bug Kodi does`nt delete the temp folder (/showthread.php?tid=208257)



Kodi does`nt delete the temp folder - CaTz - 2014-11-07

Hi,

many of the subtitles ad-dons that i built clearing the temp folder before downloading the new ones,
Those are the line of code:

PHP Code:
if xbmcvfs.exists(__temp__):
shutil.rmtree(__temp__)
xbmcvfs.mkdirs(__temp__

From some reason, in Kodi versions those lines that should delete the temp folder not delete it, and as a result Kodi loads the wrong subtitles.
The same bug appears in subscene addon, subscenter.org, subtitle.co.il, napiprojekt and more...
http://forum.kodi.tv/showthread.php?tid=184854&pid=1823049#pid1823049

Some one know how to result it?


RE: Kodi does`nt delete the temp folder - mkortstiege - 2014-11-07

Anything obvious in the debug log?


RE: Kodi does`nt delete the temp folder - robweber - 2014-11-07

Just a question but why use shutil for one call and then xbmcvfs for the other. Why not use xbmcvfs.rmdir() and see if you get a different result?


RE: Kodi does`nt delete the temp folder - CaTz - 2014-11-08

I tried to remove the folder with xbmcvfs.rmdir(), its not did the job also.

There is no something special in the debug log.

In 13.2, the same lines work perfectly.


RE: Kodi does`nt delete the temp folder - mkortstiege - 2014-11-08

please pastebin the entire debug log. it contains extra information that make it easier for the developers to reproduce and fix issues.


RE: Kodi does`nt delete the temp folder - CaTz - 2014-11-08

Found the bug, it actually was at that line:
Code:
xbmcvfs.exists(__temp__):

From some reason in Kodi version the xbmcvfs.exists requires the last slash at the folders path string, so just added it the the __temp__ parameter, and that resolved the issue.


RE: Kodi does`nt delete the temp folder - tnuc - 2014-11-08

https://github.com/amet/service.subtitles.opensubtitles/commit/bbe9a30e5c1153a57e5809ce371e7105abdb5763


RE: Kodi does`nt delete the temp folder - armedmonkey - 2014-11-12

Confirmed that the solution from tnuc's post seems to help the problem. I still get some weird errors about not finding correct subtitle in pack when i go to a second video and try to get a sub (after manually clearing the temp folder and such), but it actually does seem to load multiple subs now