sqlalchemy / sqlalchemy/mako

Dict can not be passed to a function when using the “custom tag” format

Open
#222 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.