Two try/except bugs?

3 views
Skip to first unread message

DRS

unread,
Jul 27, 2012, 7:31:02 PM7/27/12
to delug...@googlegroups.com

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 .

HTH

Diffs follow:

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):

Andrew Resch

unread,
Aug 6, 2012, 6:56:04 PM8/6/12
to delug...@googlegroups.com
This has been fixed in 1.3-stable.

Thanks.

Dan Stromberg

unread,
Aug 6, 2012, 7:53:44 PM8/6/12
to delug...@googlegroups.com
On Mon, Aug 6, 2012 at 10:56 PM, Andrew Resch <andre...@gmail.com> wrote:
This has been fixed in 1.3-stable.

Cool.

How will I know when a new release is tagged?  Is there a URL to watch or something?

Thank you!


Reply all
Reply to author
Forward
0 new messages