Merge branch 'hotfix/0.12.24'

This commit is contained in:
JackDandy 2017-07-31 20:52:19 +01:00
commit 8bb5d054d2
3 changed files with 15 additions and 3 deletions

View file

@ -1,4 +1,9 @@
### 0.12.23 (2017-07-18 16:55:00 UTC)
### 0.12.24 (2017-07-31 20:42:00 UTC)
* Fix copy post process method on posix
### 0.12.23 (2017-07-18 16:55:00 UTC)
* Remove obsolete tvrage_api lib

View file

@ -59,11 +59,18 @@ def callPeopleStupid(x):
return x.encode(sickbeard.SYS_ENCODING, 'ignore')
def fixParaLists(x):
if type(x) == list:
return [callPeopleStupid(a) if type(a) in (str, unicode) else a for a in x]
else:
return x
def ek(func, *args, **kwargs):
if os.name == 'nt':
result = func(*args, **kwargs)
else:
result = func(*[callPeopleStupid(x) if type(x) in (str, unicode) else x for x in args], **kwargs)
result = func(*[callPeopleStupid(x) if type(x) in (str, unicode) else fixParaLists(x) for x in args], **kwargs)
if type(result) in (list, tuple):
return fixListEncodings(result)

View file

@ -299,7 +299,7 @@ def listMediaFiles(path):
def copyFile(srcFile, destFile):
if os.name.startswith('posix'):
subprocess.call(['cp', srcFile, destFile])
ek.ek(subprocess.call, ['cp', srcFile, destFile])
else:
ek.ek(shutil.copyfile, srcFile, destFile)