Ticket #8374 (closed defect: fixed)

Opened 2 years ago

Last modified 7 months ago

list of index is out of range

Reported by: mark_kids@yahoo.com Assigned to: rjollos
Priority: high Component: TracMetrixPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (Last modified by rjollos)

Code fragment:
Line	
235	
236	#get index of day in the dates list
237	index = bisect(dates, date2num(date)) - 1
238	
239	for key in tkt_counts:
240	tkt_counts[key][index] = tkt_counts[key][index] + len(event[1][key])
241	
242	return tkt_counts
243	
244	
245	
Local variables:
Name	Value
date 	datetime.datetime(2011, 1, 6, 22, 3, 48, 531988, tzinfo=<LocalTimezone ...
dates 	array([], dtype=float64)
env 	<trac.env.Environment object at 0x2aaab5ff5090>
event 	(1294380228531988L, {'Leave': set([]), 'Finish': set([]), 'Enter': ...
index 	-1
key 	'Leave'
sorted_events 	[(1294380228531988L, {'Leave': set([]), 'Finish': set([]), 'Enter': ...
tkt_counts 	{'Leave': [], 'Finish': [], 'Enter': []}

Attachments

Change History

01/07/11 07:16:41 changed by rjollos

  • description changed.

There is nothing I can do with this without additional information, such as info about your Trac setup and what you were doing at the time the error occurred.

01/07/11 08:32:19 changed by anonymous

Steps to reproduce.

  1. create a new milestone
  2. add an existing ticket to the milestone.
  3. click on the tracmetrix link for the milestone.

System Information:

Trac 0.12
mod_wsgi
Python 2.6.5
pysqlite 2.4.1
sqlite 3.3.6

01/07/11 08:37:22 changed by mark_kids@yahoo.com

I've also test this on a new trac environment with the default milestones. I've only created one ticket and assigned it to one of the default milestones. The tracmetrix mdashboard give the same error.

The index variable is -1. I supposed this is what's causing the error.

01/09/11 06:22:41 changed by rjollos

  • status changed from new to assigned.
  • priority changed from normal to high.

Thanks for the detailed report. Investigating ...

10/18/12 23:06:30 changed by rjollos

  • status changed from assigned to closed.
  • resolution set to fixed.

This issue should be fixed on the trunk now. I believe it was caused by mixing non-naive datetimes with utc datetimes. I'll commit a quick bit of code cleanup now. Please reopen if you can reproduce the issue with the latest trunk code.

10/18/12 23:07:34 changed by rjollos

(In [12198]) Refs #8374: Refactored some code while debugging the issue in #8374.


Add/Change #8374 (list of index is out of range)




Change Properties
Action