#10709 closed defect (fixed)
Exception while rendering a diff file
| Reported by: | rjollos | Owned by: | ejucovy |
|---|---|---|---|
| Priority: | normal | Component: | PermRedirectPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 1.0 |
Description (last modified by rjollos)
I was investigating 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:
Traceback (most recent call last):
File "/home/user/Workspace/bloodhound/trac/trac/web/main.py", line 497, in _dispatch_request
dispatcher.dispatch(req)
File "/home/user/Workspace/bloodhound/trac/trac/web/main.py", line 236, in dispatch
self._post_process_request(req)
File "/home/user/Workspace/bloodhound/trac/trac/web/main.py", line 340, in _post_process_request
f.post_process_request(req, *(None,)*extra_arg_count)
File "/home/user/Workspace/trac-hacks/permredirectplugin/trunk/permredirect/filter.py", line 59, in post_process_request
if issubclass(exctype, PermissionError):
TypeError: issubclass() arg 1 must be a class
Full 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.
I'm not sure what the correct fix is, but the following patch makes the exception go away:
-
permredirectplugin/trunk/permredirect/filter.py
56 56 ref_url = ref_url + "?" + req.query_string 57 57 login_url = req.href.login(referer=ref_url) 58 58 59 if issubclass(exctype, PermissionError):59 if exctype and issubclass(exctype, PermissionError): 60 60 req.redirect(login_url) 61 61 62 62 try:
Attachments (1)
Change History (8)
Changed 6 months ago by anonymous
comment:1 Changed 6 months ago by rjollos
comment:2 Changed 6 months ago by ejucovy
- Resolution set to fixed
- Status changed from new to closed
comment:3 Changed 6 months ago by ejucovy
I can't reproduce this on a fresh Trac environment (trunk@11483 with no custom components other than permredirect) so let me know if this doesn't fix the issue for you.
comment:4 Changed 6 months ago by rjollos
Thanks for the fix. I'll do some testing soon and get back to you.
comment:5 Changed 4 months ago by rjollos
- Description modified (diff)
comment:6 Changed 4 months ago by rjollos
- Summary changed from Exception while rendering a patch file to Exception while rendering a diff file
comment:7 Changed 3 months ago by rjollos
The issue seems to be fixed now. Sorry I don't have more info on what the cause might have been. I'll let you know if I come across a case where the debug info you added gets logged.


The issue was confirmed with the latest version of the trunk code.