Fix #1109 auto add halting when a torrent with invalid filename encoding is in the directory

This commit is contained in:
Andrew Resch 2010-02-28 16:21:46 -08:00
parent 0ffca9a1f6
commit cfeae2baf4

View File

@ -75,7 +75,11 @@ class AutoAdd(component.Component):
for filename in os.listdir(self.config["autoadd_location"]):
if filename.split(".")[-1] == "torrent":
filepath = os.path.join(self.config["autoadd_location"], filename)
try:
filepath = os.path.join(self.config["autoadd_location"], filename)
except UnicodeDecodeError, e:
log.error("Unable to auto add torrent due to inproper filename encoding: %s", e)
continue
try:
filedump = self.load_torrent(filepath)
except (RuntimeError, Exception), e: