Browse Source

Symlink failing on encode

fix #3371
pull/3944/head
Ruud 11 years ago
parent
commit
9b62e32da8
  1. 5
      couchpotato/core/plugins/renamer.py

5
couchpotato/core/plugins/renamer.py

@ -802,9 +802,10 @@ Remove it if you want it to be renamed (again, or at least let it try again)
log.debug('Couldn\'t hardlink file "%s" to "%s". Symlinking instead. Error: %s.', (old, dest, traceback.format_exc())) log.debug('Couldn\'t hardlink file "%s" to "%s". Symlinking instead. Error: %s.', (old, dest, traceback.format_exc()))
shutil.copy(old, dest) shutil.copy(old, dest)
try: try:
symlink(dest, old + '.link') old_link = '%s.link' % sp(old)
symlink(dest, old_link)
os.unlink(old) os.unlink(old)
os.rename(old + '.link', old) os.rename(old_link, old)
except: except:
log.error('Couldn\'t symlink file "%s" to "%s". Copied instead. Error: %s. ', (old, dest, traceback.format_exc())) log.error('Couldn\'t symlink file "%s" to "%s". Copied instead. Error: %s. ', (old, dest, traceback.format_exc()))

Loading…
Cancel
Save