diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 4bb89db158653616980e89e98d14b77539290439..ad50403e066ab613c79bc5b16d29f98875bcae27 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -747,7 +747,7 @@ def chmodAsParent(childPath): parentPathStat = os.stat(parentPath) parentMode = stat.S_IMODE(parentPathStat[stat.ST_MODE]) - childPathStat = os.stat(childPath) + childPathStat = os.stat(childPath.encode(sickbeard.SYS_ENCODING)) childPath_mode = stat.S_IMODE(childPathStat[stat.ST_MODE]) if os.path.isfile(childPath): @@ -792,7 +792,7 @@ def fixSetGroupID(childPath): if parentMode & stat.S_ISGID: parentGID = parentStat[stat.ST_GID] - childStat = os.stat(childPath) + childStat = os.stat(childPath.encode(sickbeard.SYS_ENCODING)) childGID = childStat[stat.ST_GID] if childGID == parentGID: diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index b71445381e641183256df03c483d228280e44d05..ab01e21d2618b89ca3eb6e9186c8b4645c126c0c 100644 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -158,7 +158,7 @@ class PostProcessor(object): """ def recursive_glob(treeroot, pattern): results = [] - for base, _, files in os.walk(treeroot): + for base, _, files in os.walk(treeroot.encode(sickbeard.SYS_ENCODING)): goodfiles = fnmatch.filter(files, pattern) results.extend(os.path.join(base, f) for f in goodfiles) return results @@ -968,7 +968,7 @@ class PostProcessor(object): [show.indexerid, show.indexer]) # If the file season (ep_obj.season) is bigger than the indexer season (max_season[0][0]), skip the file if int(ep_obj.season) > int(max_season[0][0]): - self._log(u"File has season %s, while the indexer is on season %s. The file may be incorrectly labeled or fake, aborting." + self._log(u"File has season %s, while the indexer is on season %s. The file may be incorrectly labeled or fake, aborting." % (str(ep_obj.season), str(max_season[0][0]))) return False