Issues

Issue #193 resolved

mako-0.7.1 with python 2.4.3 raises Attribute Error

guest
created an issue

Mako-0.7.0 with python 2.4.3 raises no error. But, Mako-0.7.0 with python 2.4.3 raises Attribute Error.

Back Trace:

Traceback (most recent call last): File "gen_code.py", line 232, in ? create_file_about_each_table(output_path, file_info['FadRec%s.h'], tables) File "gen_code.py", line 174, in create_file_about_each_table template = get_template_lookup().get_template(info['template']) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/lookup.py", line 240, in get_template return self._load(srcfile, uri) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/lookup.py", line 305, in _load module_filename=module_filename, File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/template.py", line 291, in init module = self._compile_from_file(path, filename) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/template.py", line 368, in _compile_from_file filename) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/template.py", line 615, in _compile_text generate_magic_comment=template.disable_unicode) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/template.py", line 597, in _compile node = lexer.parse() File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/lexer.py", line 241, in parse if self.match_python_block(): File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/lexer.py", line 376, in match_python_block match.group(1)=='!', lineno=line, pos=pos) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/lexer.py", line 131, in append_node node = nodecls(*args, kwargs) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/parsetree.py", line 139, in init self.code = ast.PythonCode(text, self.exception_kwargs) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/ast.py", line 42, in init f.visit(expr) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/pyparser.py", line 320, in visit visitor.walk(expr, self) # , walker=walker()) File "/usr/lib64/python2.4/compiler/visitor.py", line 106, in walk walker.preorder(tree, visitor) File "/usr/lib64/python2.4/compiler/visitor.py", line 63, in preorder self.dispatch(tree, *args) # XXX *args make sense? File "/usr/lib64/python2.4/compiler/visitor.py", line 57, in dispatch return meth(node, *args) File "/usr/lib64/python2.4/compiler/visitor.py", line 40, in default self.dispatch(child, *args) File "/usr/lib64/python2.4/compiler/visitor.py", line 57, in dispatch return meth(node, *args) File "/usr/lib64/python2.4/compiler/visitor.py", line 40, in default self.dispatch(child, *args) File "/usr/lib64/python2.4/compiler/visitor.py", line 57, in dispatch return meth(node, *args) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/pyparser.py", line 262, in visitFunction self._visit_function(node, args) File "/data/asaba/hrs_trunk/tool/.virtualenvs/env1/lib/python2.4/site-packages/mako/pyparser.py", line 276, in _visit_function self.local_ident_stack = local_ident_stack.union([ AttributeError: 'str' object has no attribute 'id'

I rendered template using some parameter pattern. But error is not allways raised.

Please fix this bug.