[Python-checkins] r79749 - tracker/roundup-src/roundup/cgi/client.py

martin.v.loewis python-checkins at python.org
Sun Apr 4 20:10:39 CEST 2010


Author: martin.v.loewis
Date: Sun Apr  4 20:10:39 2010
New Revision: 79749

Log:
Issue #326: Catch IndexError.


Modified:
   tracker/roundup-src/roundup/cgi/client.py

Modified: tracker/roundup-src/roundup/cgi/client.py
==============================================================================
--- tracker/roundup-src/roundup/cgi/client.py	(original)
+++ tracker/roundup-src/roundup/cgi/client.py	Sun Apr  4 20:10:39 2010
@@ -917,7 +917,11 @@
             raise Unauthorised, self._("You are not allowed to view "
                 "this file.")
 
-        mime_type = klass.get(nodeid, 'type')
+        # MvL 20100404: catch IndexError
+        try:
+            mime_type = klass.get(nodeid, 'type')
+        except IndexError:
+            raise NotFound, designator
 
         # if the mime_type is HTML-ish then make sure we're allowed to serve up
         # HTML-ish content


More information about the Python-checkins mailing list