Modify

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#8374 closed defect (fixed)

list of index is out of range

Reported by: mark_kids@… Owned by: Ryan J Ollos
Priority: high Component: TracMetrixPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

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 (0)

Change History (6)

comment:1 Changed 6 years ago by Ryan J Ollos

Description: modified (diff)

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.

comment:2 Changed 6 years ago 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

comment:3 Changed 6 years ago by mark_kids@…

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.

comment:4 Changed 6 years ago by Ryan J Ollos

Priority: normalhigh
Status: newassigned

Thanks for the detailed report. Investigating ...

comment:5 Changed 5 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

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.

comment:6 Changed 5 years ago by Ryan J Ollos

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.