Skip to content

Commit

Permalink
Merge pull request #1066 from SickRage/bugfix-1042
Browse files Browse the repository at this point in the history
  • Loading branch information
miigotu committed Feb 22, 2016
2 parents f07dff9 + bcaac97 commit cc64ab9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sickbeard/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def copyFile(srcFile, destFile):
except (SpecialFileError, Error) as error:
logger.log(error, logger.WARNING)
except Exception as error:
logger.log(error, logger.ERROR)
logger.log(u'{}'.format(error), logger.ERROR)
else:
try:
ek(shutil.copymode, srcFile, destFile)
Expand Down Expand Up @@ -1347,10 +1347,9 @@ def touchFile(fname, atime=None):
:return: True on success, False on failure
"""

if atime and fname:
with file(fname, 'a'):
os.utime(fname, (atime, atime))
return True
if atime and fname and ek(os.path.isfile, fname):
ek(os.utime, fname, (atime, atime))
return True

return False

Expand Down

0 comments on commit cc64ab9

Please sign in to comment.