Closed alveraan closed 10 years ago
Here is a failing testcase:
@pytest.mark.usefixtures('fake_source')
def test_curly_brace_in_python_attribute_expression():
global source
source = b'''\
<html>
<a href="${request.route_url('set_locale', _query={'locale': 'de'})}"></a>
</html>
'''
list(extract_xml('filename', _options()))
The underlying problem is that the utility function to extract python expressions from an attribute value is somewhat naive and will stop at the first closing curly brace.
Using a python2.7 virtualenv with lingua 2.1 installed, I'm trying to do the following on a chameleon template:
Where lingua.cfg contains:
and test.pt contains:
This fails with the following error:
I think it has to do with the nested curly braces, because running the same command on
works without error.