Created attachment 415383 [details] Patch fixing the described exception/crash Description of problem: When clicking on the "deleted" link of an SVN item (i.e.: from a revision view), The result is: An Exception Has Occurred Python Traceback Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/viewvc/lib/viewvc.py", line 4318, in main request.run_viewvc() File "/usr/lib/python2.6/site-packages/viewvc/lib/viewvc.py", line 397, in run_viewvc self.view_func(self) File "/usr/lib/python2.6/site-packages/viewvc/lib/viewvc.py", line 2513, in view_log lastrev = pathrev_form(request, data) File "/usr/lib/python2.6/site-packages/viewvc/lib/viewvc.py", line 2225, in pathrev_form action, hidden_values = request.get_form(params={'pathrev': lastrev}) File "/usr/lib/python2.6/site-packages/viewvc/lib/viewvc.py", line 435, in get_form value=self.server.escape(value))) File "/usr/lib/python2.6/site-packages/viewvc/lib/sapi.py", line 51, in escape return escape(s) File "/usr/lib/python2.6/site-packages/viewvc/lib/sapi.py", line 36, in escape s = string.replace(s, '&', '&') File "/usr/lib64/python2.6/string.py", line 517, in replace return s.replace(old, new, maxsplit) AttributeError: 'int' object has no attribute 'replace' Version-Release number of selected component (if applicable): viewvc-1.1.5-1 How reproducible: Always Steps to Reproduce: 1. Configure viewvc to an SVN repository containing a deleted item. 2. Enter revision view mentioning a deleted item 3. Click on the "deleted" link Actual results: See above Expected results: Log view of the deleted item Additional info: This bug occurs because the SVN-specific last_rev() method may return an integer (not a string). Later, this value is expected to be a string. Please find attached a patch of my own (I'm still not a python/viewvc guru !) fixing this problem. The real problem might be more general, but the patch fixes the current case.
To your knowledge, has this issue been reported by someone upstream?
Don't know. I only checked the code in CVS visually and it does not seem fixed... at least around the instructions I acted on. I did not report it myself.
OK, thanks.
Reported upstream: http://viewvc.tigris.org/issues/show_bug.cgi?id=458
This was previously reported upstream, too. http://viewvc.tigris.org/issues/show_bug.cgi?id=454 The fix wasn't obvious in the codebase because I opted to force the escape() function to stringify its input, rather than patch this one instance of its use.
Patrick, Could you try the official patch from issue 454? Index: lib/sapi.py =================================================================== --- lib/sapi.py (revision 2369) +++ lib/sapi.py (revision 2370) @@ -33,6 +33,7 @@ # that character as-is, and sometimes needs to embed escaped values # into HTML attributes. def escape(s): + s = str(s) s = string.replace(s, '&', '&') s = string.replace(s, '>', '>') s = string.replace(s, '<', '<')
Tested: it fixes the current problem successfully.
Thank you. I'll patch, build and push to testing.
Thanks for your action and interest Bojan.
viewvc-1.1.5-2.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/viewvc-1.1.5-2.fc12
viewvc-1.1.5-2.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update viewvc'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/viewvc-1.1.5-2.fc12
viewvc-1.1.5-2.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.