Opened 15 years ago
Closed 15 years ago
#6505 closed defect (duplicate)
[Patch] TracMetrix plugin encounters internal error "TypeError: milestone_stats_data() takes at least 4 arguments (3 given)"
Reported by: | Owned by: | Bhuricha Deen Sethanandha | |
---|---|---|---|
Priority: | normal | Component: | TracMetrixPlugin |
Severity: | critical | Keywords: | |
Cc: | mrichmon@… | Trac Release: | 0.11 |
Description
Trac version: 0.11.6 TracMetrix version: 0.1.7
After installing TracMetrix pre-requistites, restarting apache and enabling TracMetrix plug-in I get an internal trac error when clicking on the TracMetrix dashboard link.
The internal error is:
Trac detected an internal error: TypeError: milestone_stats_data() takes at least 4 arguments (3 given)
How to Reproduce
While doing a GET operation on /pdashboard
, Trac issued an internal error.
(please provide additional details here)
User Agent was: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7
System Information
Trac | 0.11.6
|
Python | 2.6 (r26:66714, Dec 3 2008, 06:05:48) [GCC 4.3.2 [gcc-4_3-branch revision 141291]]
|
setuptools | 0.6c11
|
MySQL | server: "5.0.67", client: "5.0.67", thread-safe: 0
|
MySQLdb | 1.2.2
|
Genshi | 0.5.1
|
mod_python | 3.3.1
|
Pygments | 1.1.1
|
RPC | 1.0.6
|
Subversion | 1.5.7 (r36142)
|
jQuery: | 1.2.6
|
Python Traceback
Traceback (most recent call last): File "/usr/local/lib/python2.6/site-packages/Trac-0.11.6-py2.6.egg/trac/web/main.py", line 450, in _dispatch_request dispatcher.dispatch(req) File "/usr/local/lib/python2.6/site-packages/Trac-0.11.6-py2.6.egg/trac/web/main.py", line 206, in dispatch resp = chosen_handler.process_request(req) File "build/bdist.linux-i686/egg/tracmetrixplugin/web_ui.py", line 179, in process_request return self._render_view(req, db) File "build/bdist.linux-i686/egg/tracmetrixplugin/web_ui.py", line 197, in _render_view stats.append(milestone_stats_data(req, stat, milestone.name)) TypeError: milestone_stats_data() takes at least 4 arguments (3 given)
After investigation of the defect I found that milestone_stats_data()
has changed to expect the environment to be passed as a new argument. The following patch fixes this problem in TracMetrix:
--- web_ui.py.orig 2010-01-28 11:29:40.000000000 -0800 +++ web_ui.py 2010-01-28 11:21:55.000000000 -0800 @@ -194,7 +194,7 @@ tickets = get_tickets_for_milestone(self.env, db, milestone.name, 'owner') stat = get_ticket_stats(self.stats_provider, tickets) - stats.append(milestone_stats_data(req, stat, milestone.name)) + stats.append(milestone_stats_data(self.env, req, stat, milestone.name)) project = { 'name': self.env.project_name,
Attachments (0)
Change History (16)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Same problem after upgrade Trac from 0.11.1 to 0.11.6, and the fix works, thanks!
comment:3 follow-up: 5 Changed 15 years ago by
Summary: | TracMetrix plugin encounters internal error "TypeError: milestone_stats_data() takes at least 4 arguments (3 given)" → [Patch] TracMetrix plugin encounters internal error "TypeError: milestone_stats_data() takes at least 4 arguments (3 given)" |
---|
comment:4 Changed 15 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This is actually a duplicate of #6149, which has a patch file attached.
comment:5 follow-up: 6 Changed 15 years ago by
Replying to rjollos:
Issue seems to be that the call web_ui, which I think you can fix with the following change to the call to
milestone_stats_data
:milestone_stats_data(self.env, req, stat, milestone.name)See change to Trac in [t 8625] which occurred between
0.11.5
and0.11.6
.
That would be the same change as provided in the description for this patch.
comment:6 Changed 15 years ago by
Replying to anonymous:
That would be the same change as provided in the description for this patch.
Yeah, you are right ... I didn't read the description very carefully. Also wasted time tracking down a fix before I looked for open tickets.
comment:9 follow-up: 10 Changed 15 years ago by
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Note that to completely fix the problem there are two lines in mdashboard.py that also must be updated. These changes are shown in the patch below:
408c408 < data.update(milestone_stats_data(req, stat, milestone.name)) --- > data.update(milestone_stats_data(self.env, req, stat, milestone.name)) 411c411 < ticketstat.update(milestone_stats_data(req, tstat, milestone.name)) --- > ticketstat.update(milestone_stats_data(self.env, req, tstat, milestone.name))
comment:10 Changed 15 years ago by
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
Replying to mrichmon@gmail.com:
Note that to completely fix the problem there are two lines in mdashboard.py that also must be updated. These changes are shown in the patch below:
The patch in #6149 addresses this change as well.
comment:11 Changed 15 years ago by
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
I am also getting the same error.
Oops… Trac detected an internal error: TypeError: milestone_stats_data() takes at least 4 arguments (3 given) This is probably a local installation issue.
Can somebody help how to install this patch?
comment:12 Changed 15 years ago by
Cc: | mrichmon@… added; anonymous removed |
---|
I am also getting the same error.
Oops… Trac detected an internal error: TypeError?: milestone_stats_data() takes at least 4 arguments (3 given) This is probably a local installation issue.
Can somebody help how to install this patch?
comment:13 follow-up: 14 Changed 15 years ago by
I'd suggest installing the patch in #6149, which solves this problem.
Download the patch, change to the directory containing tracmetrixplugin, and run:
patch -p0 < fix__milestone_stats_data__trac0.11.diff
comment:14 follow-up: 15 Changed 15 years ago by
Replying to rjollos:
I'd suggest installing the patch in #6149, which solves this problem.
Download the patch, change to the directory containing tracmetrixplugin, and run:
patch -p0 < fix__milestone_stats_data__trac0.11.diff
When I am running this command in cmd in windows xp, the system is displaying 'patch' is not recognized as an internal or external command. Please give me the exact steps and command to install the patch.
comment:15 Changed 15 years ago by
Replying to anonymous:
When I am running this command in cmd in windows xp, the system is displaying 'patch' is not recognized as an internal or external command. Please give me the exact steps and command to install the patch.
Do you have TortoiseSVN installed? If you don't know how to apply a patch, this should be the easiest way to get you started.
The TortoiseSVN documentation can explain it better than I could.
comment:16 Changed 15 years ago by
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
The patch in #6149 will be applied soon.
Original ticket submission contains an incorrect email address. The correct address is mrichmon@…