Skip to content

Commit

Permalink
Fix shutil error + version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
enen92 committed Feb 9, 2020
1 parent 9cff6ed commit f8d1dc2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<addon id="script.module.xbmcswift2" name="xbmcswift2" provider-name="Jonathan Beluch (jbel), enen92" version="2.5.0">
<addon id="script.module.xbmcswift2" name="xbmcswift2" provider-name="Jonathan Beluch (jbel), enen92" version="2.5.1">
<requires>
<import addon="xbmc.python" version="2.14.0" />
</requires>
Expand Down
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
CHANGES
=======
Version 2.5.1 (9/2/2020)
- Fix shutil error when moving cache file

Version 2.5.0 (4/12/2019)
-------------
Expand Down
5 changes: 5 additions & 0 deletions lib/xbmcswift2/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ def sync(self):
raise
finally:
fileobj.close()

# shutil error (SameFileError when performing copyfile)
if os.path.exists(self.filename):
os.remove(self.filename)

shutil.move(tempname, self.filename) # atomic commit
if self.mode is not None:
os.chmod(self.filename, self.mode)
Expand Down

0 comments on commit f8d1dc2

Please sign in to comment.