Modify

Opened 6 years ago

Closed 4 years ago

#4151 closed defect (fixed)

ValueError: need more than 1 value to unpack

Reported by: alexei Owned by: doki_pen
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: doki_pen Trac Release: 0.11

Description

How to Reproduce

While doing a GET operation on /ticketstats, Trac issued an internal error.

Basically it just goes straight to this error when I click on Ticket Stats in the menu.

User Agent was: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)

System Information

Trac 0.11.2.1
Python 2.5.1 (r251:54863, Dec 7 2007, 23:58:55)
[GCC 4.2.1 20070719 [FreeBSD]]
setuptools 0.6c5
MySQL server: "5.1.22-rc", client: "5.1.22-rc", thread-safe: 1
MySQLdb 1.2.2
Genshi 0.6dev-r960
mod_python 3.3.1
Subversion 1.4.4 (r25188)
jQuery: 1.2.6

Python Traceback
Most recent call last: File "/usr/local/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 432, in _dispatch_request
Code fragment:

try: if not env and env_error: raise HTTPInternalError(env_error) try: dispatcher = RequestDispatcher(env)

dispatcher.dispatch(req)

except RequestDone: pass resp = req._response or [] 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 <trac.web.main.RequestDispatcher object at 0x2a7be84c>
e ValueError('need more than 1 value to unpack',)
env <trac.env.Environment object at 0x2a22148c>
env_error None
exc_info (<type 'exceptions.ValueError'>, ValueError('need more than 1 value to ...
filename '/usr/local/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/ma ...
frames [{'function': '_dispatch_request', 'lines_before': [u' try:', u' ...
has_admin True
line u' dispatcher.dispatch(req)'
lineno 431
message u'ValueError: need more than 1 value to unpack'
req <Request "GET u'/ticketstats'">
resp []
tb <traceback object at 0x2aa48b6c>
tb_hide None
traceback 'Traceback (most recent call last):\n File ...

File "/usr/local/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 174, in dispatch
Code fragment:

if not req.path_info or req.path_info == '/': chosen_handler = self.default_handler # pre-process any incoming request, whether a handler # was found or not chosen_handler = self._pre_process_request(req,

chosen_handler)

except TracError, e: raise HTTPInternalError(e) if not chosen_handler: if req.path_info.endswith('/'): # Strip trailing / and redirect

Local variables:

Name Value
chosen_handler <ticketstats.ticketstats.TicketStatsPlugin object at 0x2a7bec8c>
chrome <trac.web.chrome.Chrome object at 0x2a7be0cc>
err (<type 'exceptions.ValueError'>, ValueError('need more than 1 value to ...
handler <ticketstats.ticketstats.TicketStatsPlugin object at 0x2a7bec8c>
req <Request "GET u'/ticketstats'">
self <trac.web.main.RequestDispatcher object at 0x2a7be84c>

File "/usr/local/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 295, in _pre_process_request
Code fragment:

req.outcookietrac_form_token?secure? = True return req.outcookietrac_form_token?.value def _pre_process_request(self, req, chosen_handler): for filter_ in self.filters:

chosen_handler = filter_.pre_process_request(req, chosen_handler)

return chosen_handler def _post_process_request(self, req, *args): nbargs = len(args) resp = args

Local variables:

Name Value
chosen_handler <ticketstats.ticketstats.TicketStatsPlugin object at 0x2a7bec8c>
filter_ <announcerplugin.subscribers.watchers.WatchSubscriber object at ...
req <Request "GET u'/ticketstats'">
self <trac.web.main.RequestDispatcher object at 0x2a7be84c>

File "build/bdist.freebsd-7.0-RELEASE-i386/egg/announcerplugin/subscribers/watchers.py", line 142, in pre_process_request
Local variables:
Name Value
handler <ticketstats.ticketstats.TicketStatsPlugin object at 0x2a7bec8c>
path u'ticketstats'
pattern u'ticket/*'
req <Request "GET u'/ticketstats'">
self <announcerplugin.subscribers.watchers.WatchSubscriber object at ...
File "/usr/local/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 432, in _dispatch_request

dispatcher.dispatch(req)

File "/usr/local/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 174, in dispatch

chosen_handler)

File "/usr/local/lib/python2.5/site-packages/Trac-0.11.2.1-py2.5.egg/trac/web/main.py", line 295, in _pre_process_request

chosen_handler = filter_.pre_process_request(req, chosen_handler)

File "build/bdist.freebsd-7.0-RELEASE-i386/egg/announcerplugin/subscribers/watchers.py", line 142, in pre_process_request

Attachments (0)

Change History (7)

comment:1 Changed 5 years ago by jensen@…

  • Trac Release changed from 0.10 to 0.11

I am having the same issue. Has this ever been resolved?

comment:2 Changed 5 years ago by thinice@…

Same issue here ;

Seems that when i'm -not- logged in I can view the stats, but when I'm logged in under a username with, and without the TSTATS_VIEW permission I get the error.

comment:3 Changed 5 years ago by cboos

  • Component changed from TracTicketStatsPlugin to AnnouncerPlugin
  • Owner changed from echo0101 to ixokai

#T8885 was a duplicate.

It seems to be an AnnouncerPlugin bug, as it probably "watches" for /ticket... and here it matches /ticketstats.

Ok, looking at the code, the watchable_paths are specified as glob patterns, but in post_process_request, a re.match is done, which explains why ticket/* will match ticketstats ;-)

Should use fnmatch.fnmatch instead.

comment:4 Changed 5 years ago by cboos

  • Cc doki_pen added

Looks like doki_pen is not set as owner...

comment:5 Changed 5 years ago by vasi_nemes

Can somebody submit a patch please? Announcer breaks several plugins which have menu items that contain "ticket" in their name like Ticketstats or Gantt Tickets

comment:6 Changed 4 years ago by doki_pen

  • Owner changed from ixokai to doki_pen
  • Status changed from new to assigned

comment:7 Changed 4 years ago by doki_pen

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [7679]) fixes path matching in watcher.py

fixes #4151

Conflicts:

announcerplugin/subscribers/watchers.py

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from doki_pen. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.