id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
10709,Exception while rendering a diff file,rjollos,ejucovy,I was investigating [https://issues.apache.org/bloodhound/ticket/308#comment:3 Bloodhound issue #308]_ and trying to determine why `.patch` files rendered with syntax highlighting_ but `.diff` files did not. The issue I'm reporting here appears to be unrelated. During the rendering of `.diff` files I saw the following traceback:\r\n{{{\r\nTraceback (most recent call last):\r\n  File "/home/user/Workspace/bloodhound/trac/trac/web/main.py"_ line 497_ in _dispatch_request\r\n    dispatcher.dispatch(req)\r\n  File "/home/user/Workspace/bloodhound/trac/trac/web/main.py"_ line 236_ in dispatch\r\n    self._post_process_request(req)\r\n  File "/home/user/Workspace/bloodhound/trac/trac/web/main.py"_ line 340_ in _post_process_request\r\n    f.post_process_request(req_ *(None_)*extra_arg_count)\r\n  File "/home/user/Workspace/trac-hacks/permredirectplugin/trunk/permredirect/filter.py"_ line 59_ in post_process_request\r\n    if issubclass(exctype_ PermissionError):\r\nTypeError: issubclass() arg 1 must be a class\r\n}}}\r\n\r\nFull traceback is attached. To reproduce_ attach a file ending in `.diff` to a ticket and then view the file. You may be able to reproduce under other circumstances as well ... I haven't investigated thoroughly.\r\n\r\nI'm not sure what the correct fix is_ but the following patch makes the exception go away:\r\n{{{\r\n#!patch\r\nIndex: permredirectplugin/trunk/permredirect/filter.py\r\n===================================================================\r\n--- permredirectplugin/trunk/permredirect/filter.py	(revision 12442)\r\n+++ permredirectplugin/trunk/permredirect/filter.py	(working copy)\r\n@@ -56_7 +56_7 @@\r\n                 ref_url = ref_url + "?" + req.query_string\r\n             login_url = req.href.login(referer=ref_url)\r\n \r\n-            if issubclass(exctype_ PermissionError):\r\n+            if exctype and issubclass(exctype_ PermissionError):\r\n                 req.redirect(login_url)\r\n             \r\n             try:\r\n}}},defect,closed,normal,PermRedirectPlugin,normal,fixed,,,1.0
