Opened 16 years ago
Last modified 9 years ago
#387 new defect
strange isolated backtrace originating in template.interpolation.lex
| Reported by: | cboos | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.9 |
| Component: | Template processing | Version: | 0.6 |
| Keywords: | weird | Cc: | guillaume@… |
Description
Found in the trac.log from a few days ago:
[pid 1100343632] 2010-05-09 06:32:44,668 Trac[env] INFO: -------------------------------- environment startup [Trac 0.12dev-r9640] --------------------------------
[pid 1092462928] 2010-05-09 06:32:44,760 Trac[env] INFO: -------------------------------- environment startup [Trac 0.12dev-r9640] --------------------------------
[pid 1228458320] 2010-05-09 06:33:26,063 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
[pid 1209448784] 2010-05-09 06:33:26,114 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
[pid 1167485264] 2010-05-09 06:33:31,058 Trac[api] WARNING: Discarding duplicate repository ''
[pid 1125521744] 2010-05-09 06:33:41,200 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 512, in _dispatch_request
dispatcher.dispatch(req)
File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 255, in dispatch
content_type)
File "build/bdist.linux-x86_64/egg/trac/web/chrome.py", line 832, in render_template
stream = template.generate(**data)
File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 532, in generate
stream = self.stream
File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 442, in stream
self._stream = list(self._prepare(self._stream))
File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 478, in _prepare
yield kind, (directives, list(substream)), pos
File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 478, in _prepare
yield kind, (directives, list(substream)), pos
File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 478, in _prepare
yield kind, (directives, list(substream)), pos
File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 493, in _prepare
for event in tmpl.stream:
File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 442, in stream
self._stream = list(self._prepare(self._stream))
File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 288, in _prepare
self._extract_includes(self._interpolate_attrs(stream))
File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 210, in _extract_includes
for kind, data, pos in stream:
File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 278, in _interpolate_attrs
pos[2], lookup=self.lookup))
File "build/bdist.linux-x86_64/egg/genshi/template/interpolation.py", line 69, in interpolate
for is_expr, chunk in chain(lex(text, pos, filepath), [(True, '')]):
File "build/bdist.linux-x86_64/egg/genshi/template/interpolation.py", line 106, in lex
offset = text.find(PREFIX, pos)
AttributeError: 'list' object has no attribute 'find'
This was for a request to #T4824, but that page doesn't seem to have any problem now.
Note that this was right after a restart of the environment, so that could well be related to the TemplateLoader not being fully initialized, a concurrency issue there.
(+ please add a 0.6 Version)
Change History (3)
comment:1 in reply to: ↑ description Changed 16 years ago by cmlenz
- Version set to 0.6
comment:2 Changed 14 years ago by Guillaume Pratte <guillaume@…>
- Cc guillaume@… added
I had exactly the same stacktrace.
In my case, the "text" variable content is a list :
[('EXPR', Expression(u"env['paste.config']['sitePath']"), (u'site/main.html', 320, 14)), ('TEXT', u'/index.html?lang=en', (u'site/main.html', 320, 45))]
In main.html, I have :
<xi:include href="includes/languages.inc.html"><xi:fallback>
<a href="${env['paste.config']['sitePath']}/index.html?lang=en" rel="external">
EN
</a>
/
<a href="${env['paste.config']['sitePath']}/index.html?lang=fr" rel="external">
FR
</a>
</xi:fallback></xi:include>
It seems ${} expressions are not properly evaluated inside a <xi:fallback> tag?
comment:3 Changed 9 years ago by hodgestar
- Milestone changed from 0.7 to 0.9
Moved to milestone 0.9.

Replying to cboos:
Oops, done.