Your message dated Mon, 17 Feb 2014 13:49:00 -0500
with message-id 
<cal6k_aycgevj_frwcchkt-fjedes_lhh-wvc_gp0qrbfbhf...@mail.gmail.com>
and subject line Fixed upstream
has caused the Debian Bug report #688467,
regarding deluge: except shadows builtin ValueError and TypeError
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
688467: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688467
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: deluge
Version: 1.3.3-2
Severity: normal
Tags: upstream patch

lintian4py reports amongst others the following issues on deluge:

e: deluge-common: except-shadows-builtin 
usr/share/pyshared/deluge/core/torrentmanager.py:589: ValueError
e: deluge-gtk: except-shadows-builtin 
usr/share/pyshared/deluge/ui/gtkui/torrentview.py:496: TypeError

From the tag's description:
N:   One error that Python programmers occasionally make is writing the
N:   following code:
N:
N:     try:
N:         ...
N:     except TypeError, ValueError:  # Wrong!
N:         ...
N:
N:   The author is probably trying to catch both TypeError and ValueError
N:   exceptions, but this code actually does something different: it will
N:   catch TypeError and bind the resulting exception object to the local
N:   name ValueError. The ValueError exception will not be caught at all.
N:   The correct code specifies a tuple of exceptions:
N:
N:     try:
N:         ...
N:     except (TypeError, ValueError):
N:         ...
N:
N:   Refer to
N:   http://docs.python.org/whatsnew/2.6.html#pep-3110-exception-handling-c
N:   hanges for details.

Please find attached a patch to fix the issue.

Regards
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index a14e715..d5d1c83 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -586,7 +586,7 @@ class TorrentManager(component.Component):
         # 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
diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py
index e324d76..16c41d1 100644
--- a/deluge/ui/gtkui/torrentview.py
+++ b/deluge/ui/gtkui/torrentview.py
@@ -493,7 +493,7 @@ class TorrentView(listview.ListView, component.Component):
                 return []
 
             return torrent_ids
-        except ValueError, TypeError:
+        except (ValueError, TypeError):
             return []
 
     def get_torrent_status(self, torrent_id):

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Version: 1.3.6-1

--- End Message ---

Reply via email to