diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 67d9324db0b182ac5a2ad3a65de292d6d8638b23..62d5046b1c34bd5106c5c2ae1f4b99cf2e8bd14f 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -443,7 +443,9 @@ def chmodAsParent(childPath): return parentMode = stat.S_IMODE(os.stat(parentPath)[stat.ST_MODE]) - childPath_mode = stat.S_IMODE(os.stat(childPath)[stat.ST_MODE]) + + childPathStat = ek.ek(os.stat, childPath) + childPath_mode = stat.S_IMODE(childPathStat[stat.ST_MODE]) if ek.ek(os.path.isfile, childPath): childMode = fileBitFilter(parentMode) @@ -453,7 +455,7 @@ def chmodAsParent(childPath): if childPath_mode == childMode: return - childPath_owner = os.stat(childPath).st_uid + childPath_owner = childPathStat.st_uid user_id = os.geteuid() if user_id !=0 and user_id != childPath_owner: @@ -483,12 +485,13 @@ def fixSetGroupID(childPath): if parentMode & stat.S_ISGID: parentGID = parentStat[stat.ST_GID] - childGID = os.stat(childPath)[stat.ST_GID] + childStat = ek.ek(os.stat, childPath) + childGID = childStat[stat.ST_GID] if childGID == parentGID: return - childPath_owner = os.stat(childPath).st_uid + childPath_owner = childStat.st_uid user_id = os.geteuid() if user_id !=0 and user_id != childPath_owner: