From cfeae2baf4efea51f506880fb5c9302e614a052e Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 28 Feb 2010 16:21:46 -0800 Subject: [PATCH] Fix #1109 auto add halting when a torrent with invalid filename encoding is in the directory --- deluge/core/autoadd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/core/autoadd.py b/deluge/core/autoadd.py index 6a5e3d02c..6d3d7a8bc 100644 --- a/deluge/core/autoadd.py +++ b/deluge/core/autoadd.py @@ -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: