It looks to me like deluge 1.3.5 has a pair of try/except bugs. IINM, the second exception value (sans parentheses) gets overwritten by exception info from the first, and the second is never caught. This is a relatively common source of bugs in Python 2.x, and I believe this is why the syntax of try/except changed in 3.x .
Index: deluge/core/torrentmanager.py
===================================================================
--- deluge/core/torrentmanager.py (revision 61847)
+++ deluge/core/torrentmanager.py (working copy)
@@ -595,7 +603,7 @@
# Remove the torrent from deluge's session
try:
del self.torrents[torrent_id]
- except KeyError, ValueError:
+ except (KeyError, ValueError):
return False
# Save the session state
Index: deluge/ui/gtkui/torrentview.py
===================================================================
--- deluge/ui/gtkui/torrentview.py (revision 61847)
+++ deluge/ui/gtkui/torrentview.py (working copy)
@@ -516,7 +516,7 @@
return []
return torrent_ids
- except ValueError, TypeError:
+ except (ValueError, TypeError):
return []
def get_torrent_status(self, torrent_id):