id summary reporter owner description type status priority component severity resolution keywords cc release 5772 Can't watch tickets Jimmy Martin Scharrer "Hi, I installed Watchlist plugin on my TRAC 0.11.3. It's a good plugin to make me to watch my favorite tickets and wikis. I can add a wiki to my watchlist, but I can't add a ticket to the list. When I clicked ""watch"" in the ticket page, I got the internal error below. Oops… Trac detected an internal error: NameError: global name 'commentnum' is not defined This is probably a local installation issue. Found a bug in Trac? If you think this should work and you can reproduce the problem, you should consider reporting this to the Trac team. Before you do that, though, please first try searching for similar issues, as it is quite likely that this problem has been reported before. For questions about installation and configuration of Trac, please try the mailing list instead of filing a ticket. Otherwise, please ==== How to Reproduce ==== While doing a GET operation on `/watchlist`, Trac issued an internal error. ''(please provide additional details here)'' Request parameters: {{{ {'action': u'watch', 'is_watching': False, 'realm': u'ticket', 'resid': u'1', 'ticket_perm': True, 'wiki_perm': True, 'wikilist': []} }}} User Agent was: `Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5 (.NET CLR 3.5.30729)` ==== System Information ==== || '''Trac''' || `0.11.3` || || '''Python''' || `2.5.1 (r251:54863, Jun 15 2008, 18:24:51) ` [[br]] `[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)]` || || '''setuptools''' || `0.6c9` || || '''SQLite''' || `3.5.9` || || '''pysqlite''' || `2.3.3` || || '''Genshi''' || `0.5.1` || || '''Pygments''' || `1.0` || || '''GIT''' || `1.5.6.6` || || '''jQuery:''' || `1.2.6` || ==== Python Traceback ==== {{{ Traceback (most recent call last): File ""/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py"", line 435, in _dispatch_request dispatcher.dispatch(req) File ""/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py"", line 205, in dispatch resp = chosen_handler.process_request(req) File ""build/bdist.linux-i686/egg/tracwatchlist/plugin.py"", line 221, in process_request changes.extend( [format_change(field,oldvalue,newvalue), tag(""; "") ]) File ""build/bdist.linux-i686/egg/tracwatchlist/plugin.py"", line 204, in format_change href=href('ticket',id,action='diff',version=commentnum)), "")"") NameError: global name 'commentnum' is not defined }}} a new ticket at the Trac project site, where you can describe the problem and explain how to reproduce it. Python Traceback Most recent call last: * File ""/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py"", line 435, in _dispatch_request Code fragment: 430. try: 431. if not env and env_error: 432. raise HTTPInternalError(env_error) 433. try: 434. dispatcher = RequestDispatcher(env) 435. dispatcher.dispatch(req) 436. except RequestDone: 437. pass 438. resp = req._response or [] 439. 440. except HTTPException, e: Local variables: Name Value after [u' except RequestDone:', u' pass', u' resp = ... before [u' try:', u' if not env and env_error:', u' raise ... dispatcher e NameError(""global name 'commentnum' is not defined"",) env env_error None exc_info (, NameError(""global name 'commentnum' is not ... filename '/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py' frames [{'function': '_dispatch_request', 'lines_before': [u' try:', u' ... has_admin True line u' dispatcher.dispatch(req)' lineno 434 message u""NameError: global name 'commentnum' is not defined"" req resp [] tb tb_hide None traceback 'Traceback (most recent call last):\n File ... * File ""/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py"", line 205, in dispatch Code fragment: 200. req.args.get('__FORM_TOKEN') != req.form_token: 201. raise HTTPBadRequest('Missing or invalid form token. ' 202. 'Do you have cookies enabled?') 203. 204. # Process the request and render the template 205. resp = chosen_handler.process_request(req) 206. if resp: 207. if len(resp) == 2: # Clearsilver 208. chrome.populate_hdf(req) 209. template, content_type = \ 210. self._post_process_request(req, *resp) Local variables: Name Value chosen_handler chrome err (, NameError(""global name 'commentnum' is not ... handler req self * File ""build/bdist.linux-i686/egg/tracwatchlist/plugin.py"", line 221, in process_request Local variables: Name Value action 'view' args {'resid': u'1', 'wikilist': [], 'ticket_perm': True, 'action': u'watch', ... author u'Jimmy.Wu' author_ u'Jimmy.Wu' changes [, ] changetime 1251798343 count (1,) cursor db field u'description' format_change href id 1 is_watching False lst (u'Jimmy.Wu', u'ticket', u'1') newvalue u'= bug description =\r\n\r\n= bug analysis =\r\naaa\r\n= fix ... oldvalue u'= bug description =\r\n\r\n= bug analysis =\r\n\r\n= fix recommendation ... realm u'ticket' realm_perm True reporter u'Jimmy.Wu' req resid u'1' self summary u'test' ticket_perm True ticketlist [] tickets [(1, u'enhancement', 1251797379, 1251798343, u'test', u'Jimmy.Wu')] time 1251797379 timeline '/sw1-trac/timeline?precision=seconds&from=' timeline_link type u'enhancement' user u'Jimmy.Wu' wiki_perm True wikilist [] wldict {'resid': u'1', 'wikilist': [], 'ticket_perm': True, 'action': u'watch', ... wlhref '/sw1-trac/watchlist' * File ""build/bdist.linux-i686/egg/tracwatchlist/plugin.py"", line 204, in format_change Local variables: Name Value field u'description' fieldtag href id 1 newvalue u'= bug description =\r\n\r\n= bug analysis =\r\naaa\r\n= fix ... oldvalue u'= bug description =\r\n\r\n= bug analysis =\r\n\r\n= fix recommendation ... self File ""/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py"", line 435, in _dispatch_request dispatcher.dispatch(req) File ""/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/web/main.py"", line 205, in dispatch resp = chosen_handler.process_request(req) File ""build/bdist.linux-i686/egg/tracwatchlist/plugin.py"", line 221, in process_requestFile ""build/bdist.linux-i686/egg/tracwatchlist/plugin.py"", line 204, in format_change" defect closed high WatchlistPlugin major fixed 0.11