Skip to content

TemplateSyntaxError from included template has source#1112

Merged
davidism merged 1 commit intomasterfrom
include-syntax-error-source
Dec 3, 2019
Merged

TemplateSyntaxError from included template has source#1112
davidism merged 1 commit intomasterfrom
include-syntax-error-source

Conversation

@davidism
Copy link
Copy Markdown
Member

@davidism davidism commented Dec 3, 2019

fixes #457

Rendering the included template caught, processed, and re-raised the TemplateSyntaxError, which was then caught and processed again in the top-level render call. Now prevent such tracebacks from being faked a second time.

This also fixes an issue introduced by #1110 that omitted the other template frames and only showed the template with the syntax error.

@davidism davidism added this to the 2.11.0 milestone Dec 3, 2019
@davidism davidism force-pushed the include-syntax-error-source branch from af8a474 to 2b0d1ed Compare December 3, 2019 21:22
@davidism davidism merged commit 28f12c0 into master Dec 3, 2019
@davidism davidism deleted the include-syntax-error-source branch December 3, 2019 21:26
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jinja2.exceptions.TemplateSyntaxError.source is empty for included files

1 participant