Module: deluge
Branch: 1.2-stable
Commit: 9250bbfb8920c06a59032979d371f5ce18b98946

Author: Andrew Resch <[email protected]>
Date:   Sun Feb 28 16:21:46 2010 -0800

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

---

 deluge/core/autoadd.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/deluge/core/autoadd.py b/deluge/core/autoadd.py
index 6a5e3d0..6d3d7a8 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:

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to