sqlalchemy / sqlalchemy/mako

Control statements don't follow line-wrapping rules

Open
#195 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature 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

% for item in [
        'some',
        'long',
        'list',
        'of',
        'items',
    ]:
    ${item}
% endfor

Produces:

CompileException: Fragment 'for item in [' is not a partial control statement in file...

Adding backslashes to the end of every line works, but normal Python wrapping ought to apply here.

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

Reproduce the shown Mako template and inspect the path that raises the CompileException for a multiline control statement. Trace how control statements are parsed, then add a regression test demonstrating that normal Python-style line wrapping works without backslashes; done means the example compiles and renders successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.