Re: [viewvc-dev] viewvc-1.1.16: UnboundLocalError: local variable 'log_pagestart' referenced before assignment

olli hauer <[email protected]> Thu, 25 Oct 2012 17:39:53 +0200
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Message-ID <[email protected]>
On 2012-10-25 15:38, C. Michael Pilato wrote:
> I can confirm this problem, and apologize for the sloppy coding. :-(


Thanks for the quick patch and rolling a new tar file!

New version committed at the moment
http://www.freshports.org/devel/viewvc/


--
Regards,
olli


> 
> This patch should fix the bug:
> 
> Index: lib/viewvc.py
> ===================================================================
> --- lib/viewvc.py	(revision 2803)
> +++ lib/viewvc.py	(working copy)
> @@ -2551,6 +2551,7 @@
>        sortby = vclib.SORTBY_DEFAULT
> 
>    first = last = 0
> +  log_pagestart = None
>    if cfg.options.log_pagesize:
>      log_pagestart = int(request.query_dict.get('log_pagestart', 0))
>      total = cfg.options.log_pagesextra * cfg.options.log_pagesize
> 
> 
> On 10/25/2012 01:20 AM, olli hauer wrote:
>> After upgrade to viewvc-1.1.16 I get the error below,
>> downgrade back to 1.1.15 issue went away.
>>
>> - Browsing the repo OK until a single file is selected.
>> - /viewvc/trunk/CHANGES?view=markup => working
>> - /viewvc?view=revision&revision=2806 => working
>> - /viewvc?view=revision&revision=2806 -> select [trunk/CHANGES] => working
>> - /viewvc?view=revision&revision=2806 -> select [modified] => error
>> - /viewvc?view=revision&revision=2806 -> select [text changed] => working
>>
>> Python version: python 2.7.3
>> Pygments version: pygments-1.5
>>
>>
>> Python Traceback
>>
>> Traceback (most recent call last):
>>   File "/usr/local/viewvc/lib/viewvc.py", line 4675, in main
>>     request.run_viewvc()
>>   File "/usr/local/viewvc/lib/viewvc.py", line 395, in run_viewvc
>>     self.view_func(self)
>>   File "/usr/local/viewvc/lib/viewvc.py", line 2678, in view_log
>>     'log_pagestart': log_pagestart},
>> UnboundLocalError: local variable 'log_pagestart' referenced before assignment
>>
>>
>> // olli
>>
>> ------------------------------------------------------
>> http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4251&dsMessageId=3023337
>>
>> To unsubscribe from this discussion, e-mail: [[email protected]].
>>
> 
>

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4251&dsMessageId=3023489

To unsubscribe from this discussion, e-mail: [[email protected]].