sqlalchemy / sqlalchemy/mako

emit warning when a block or def is named "body"

Open
#263 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
459
Forks
90
PR merge metrics
No merged PRs in 30d

Description

Migrated issue, originally created by Bérenger Enselme (@benselme)

This is using CPython 3.6.1

from mako.template import Template

if __name__ == '__main__':
    s = Template("""aaaa<%block name="bodi"></%block>bbbb""").render()
    assert s == 'aaaabbbb'  # success
    s = Template("""aaaa<%block name="body"></%block>bbbb""").render()
    assert s == 'aaaabbbb'  # failure, s == '\n '

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 supplied Template example first and compare the output for block names "bodi" and "body". Trace how Template processes block and def names, then verify that naming either one "body" emits a warning while rendering still produces the expected content.

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.