Dict can not be passed to a function when using the “custom tag” format
Open
Nobody has claimed this yet.
bug
lexer
low priority
- Dominant language
- Python
- Stars
- 459
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
Migrated issue, originally created by Anonymous
A SyntaxError (unexpected EOF) is raised when trying to pass a dict.
<%form:form id="service-form"
action="${request.current_route_url(action='update')}"
buttons="${False}"
data_attrs="${ {'data-form-primary': ''} }">
I am using mako 0.8.1, python 2.7 on OSX 10.8.
A workaround is to use the dict constructor or to declare the dict before passing it
e.g.
<% data_attr={'data-form-primary': ''} %>
<%form:form id="service-form"
action="${request.current_route_url(action='update')}"
buttons="${False}"
data_attrs="${ data_attr }">
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Reproduce the custom-tag template example with the dict expression in the stated Mako/Python environment, then trace the template expression parsing; done means the dict can be passed without the unexpected EOF SyntaxError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100