Skip to content

Commit

Permalink
Merge pull request #458 from kevinoid/fix-cover-tmp-fs
Browse files Browse the repository at this point in the history
Fix cover file saving with /tmp on different FS
  • Loading branch information
JoeLametta authored Jan 28, 2020
2 parents 553a6de + b6607c6 commit ee11fac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion whipper/common/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import musicbrainzngs
import re
import os
import shutil
import time

from tempfile import NamedTemporaryFile
Expand Down Expand Up @@ -495,7 +496,7 @@ def getCoverArt(self, path, release_id):
with NamedTemporaryFile(suffix='.cover.jpg', delete=False) as f:
f.write(data)
os.chmod(f.name, 0o644)
os.replace(f.name, cover_art_path)
shutil.move(f.name, cover_art_path)
logger.debug('cover art fetched at: %r', cover_art_path)
return cover_art_path
return
Expand Down

0 comments on commit ee11fac

Please sign in to comment.