﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
158	"Unexpected ""undefined"" error"	cboos	cmlenz	"While stress-testing Trac, I sometimes get weird Genshi errors, using a fairly recent build (0.5dev-r766, well, that's the latest even).

{{{
KeyError: <Undefined 'name'>
}}}

and the one line backtrace is:
{{{
 File ""...\trunk\trac\ticket\templates\query_results.html"", line 48, in  <Suite u'name = header.name; value = result[name]'>  
}}}

The actual line content is:
{{{
#!genshi
 <py:with vars=""name = header.name; value = result[name]"">
}}}

The data section shows the following for `header` (with less truncation than usual in order to get the full representation):
{{{
header  	{'href': '/devel/query?group=status&order=owner&milestone=This+is+a+stupid+milestone', 'name': 'owner', 'label': 'Owner'}
}}}

As you can see, there's an entry for `'name'` here.

Needless to say, when reloading the page after the error, it displays just fine, so it's really a transient error triggered by the testing conditions and probably due to some race condition.

Just another thought: line 47 is 
{{{
#!genshi
<py:for each=""idx, header in enumerate(headers)"" py:choose="""">
}}}
so perhaps it's a bug in enumerate... but that would be scary as well!

=== How to reproduce ===

Start tracd, in a new firefox window, open something like twenty tabs, half of them custom query views. Restart tracd. ""Load all tabs"".
If you're lucky, one of the custom query view will show the above backtrace.
"	defect	closed	major	0.5	Expression evaluation	devel	fixed		
