#256 closed defect (worksforme)
incorrect undefined variable
Reported by: | wichert@… | Owned by: | cmlenz |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | General | Version: | 0.5.1 |
Keywords: | Cc: |
Description
This template snippet:
<blockquote py:with="quote=h.quote()"> <strong py:attrs="dict(style=quote['style'])">"${quote["quote"]}"</strong> <em>${quote["author"]}</em> </blockquote>
produces this traceback when rendered:
File 'build/bdist.macosx-10.3-fat/egg/genshi/core.py', line 154 in render File 'build/bdist.macosx-10.3-fat/egg/genshi/output.py', line 45 in encode File 'build/bdist.macosx-10.3-fat/egg/genshi/output.py', line 274 in __call__ File 'build/bdist.macosx-10.3-fat/egg/genshi/output.py', line 519 in __call__ File 'build/bdist.macosx-10.3-fat/egg/genshi/output.py', line 679 in __call__ File 'build/bdist.macosx-10.3-fat/egg/genshi/output.py', line 459 in __call__ File 'build/bdist.macosx-10.3-fat/egg/genshi/core.py', line 212 in _ensure File 'build/bdist.macosx-10.3-fat/egg/genshi/template/markup.py', line 252 in _include File 'build/bdist.macosx-10.3-fat/egg/genshi/template/markup.py', line 297 in _match File 'build/bdist.macosx-10.3-fat/egg/genshi/template/markup.py', line 242 in _exec File 'build/bdist.macosx-10.3-fat/egg/genshi/template/base.py', line 421 in _eval File 'build/bdist.macosx-10.3-fat/egg/genshi/template/eval.py', line 136 in evaluate File '/local/simplon/2style4you/code/buildout/devel/src/tostyle4you/tostyle4you/templates/retailer/clothing_add.html', line 69 in <Expression u"quote['quote']"> <strong py:attrs="dict(style=quote['style'])">${quote['quote']}</strong> File 'build/bdist.macosx-10.3-fat/egg/genshi/template/eval.py', line 281 in lookup_item File 'build/bdist.macosx-10.3-fat/egg/genshi/template/eval.py', line 236 in _die UndefinedError: "quote" not defined
}}}
Change History (3)
comment:1 Changed 16 years ago by wichert@…
- Version changed from 0.4.4 to 0.5.1
comment:2 Changed 16 years ago by cmlenz
- Milestone 0.6 deleted
- Resolution set to worksforme
- Status changed from new to closed
I suspect you got the Genshi namespace URI wrong in that template (for example, missing the trailing slash?)
Please reopen if that's not the case, and provide some more info.
comment:3 Changed 16 years ago by wichert@…
The namespace URI was correct.
I have since switched to using chameleon.genshi as implementation of the Genshi syntax, which fixed this for me.
Note: See
TracTickets for help on using
tickets.
Genshi 0.5.1 has the same result as 0.4.4.