From a8787bc0d35990d47eee99e21c20689b6676b0b6 Mon Sep 17 00:00:00 2001 From: elijordan Date: Sat, 17 Jan 2015 12:17:06 +1100 Subject: [PATCH] use os.system for file copies on posix systems --- sickbeard/helpers.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 801990d6..0f15c627 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -342,7 +342,11 @@ def listMediaFiles(path): def copyFile(srcFile, destFile): - ek.ek(shutil.copyfile, srcFile, destFile) + if isPosix(): + os.system('cp "%s" "%s"' % (srcFile, destFile)) + else: + ek.ek(shutil.copyfile, srcFile, destFile) + try: ek.ek(shutil.copymode, srcFile, destFile) except OSError: @@ -366,6 +370,12 @@ def link(src, dst): else: os.link(src, dst) +def isPosix(): + if os.name.startswith('posix'): + return True + else: + return False + def hardlinkFile(srcFile, destFile): try: