From aba5cc10d28e36db285d0450c48f3deb802169f7 Mon Sep 17 00:00:00 2001 From: dhellwich Date: Sun, 20 Jul 2014 21:47:37 +0200 Subject: [PATCH] Fix for symlinking during Post-Processing As described here: https://sickrage.tv/forums/forum/help-support/bug-issue-reports/5016-several-issues --- sickbeard/helpers.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 88560834..96927b41 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -462,16 +462,12 @@ def hardlinkFile(srcFile, destFile): copyFile(srcFile, destFile) -def symlink(srcFile, destFile): +def symlink(src, dst): if os.name == 'nt': import ctypes - - if ctypes.windll.kernel32.CreateSymbolicLinkW(unicode(destFile), unicode(srcFile), - 1 if os.path.isdir(srcFile) else 0) in [0, - 1280]: - raise ctypes.WinError() - else: - os.symlink(srcFile, destFile) + if ctypes.windll.kernel32.CreateSymbolicLinkW(unicode(dst), unicode(src), 1 if os.path.isdir(src) else 0) in [0,1280]: raise ctypes.WinError() + else: + os.symlink(src, dst) def moveAndSymlinkFile(srcFile, destFile):