Skip to content

Commit c31d8cf

Browse files
committed
more consolidation of changelogs
Change-Id: I292058f8a30b9ff3f093b4ecd35a7713db8b42cd
1 parent 497236d commit c31d8cf

4 files changed

Lines changed: 39 additions & 38 deletions

File tree

‎doc/build/unreleased/245.rst‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎doc/build/unreleased/428.rst‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎doc/build/unreleased/430.rst‎

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.. change::
2+
:tags: bug, exceptions
3+
:tickets: 430, 245, 428
4+
5+
A series of fixes involving syntax warnings and exceptions found
6+
during template lexing / compilation:
7+
8+
* Warnings raised while a template is compiled, which in practice means
9+
``SyntaxWarning``, now report the filename and line number of the
10+
template rather than a line within the generated module, and are no
11+
longer reported twice. This applies equally to templates compiled from a
12+
string, from a file, and to a module file in a
13+
:paramref:`.Template.module_directory`, as does a warning raised while
14+
the module level code of a ``<%! %>`` block runs. Warnings raised while
15+
a template renders continue to report the location within the generated
16+
module.
17+
18+
To do this, Mako replaces ``warnings.showwarning`` while a template is
19+
compiled. As that name is global to the process, an unrelated warning
20+
displayed by another thread during that window may also be passed through
21+
Mako's hook, which shows any warning it does not recognize unchanged.
22+
(:ticket:`430`)
23+
24+
* The ``SyntaxException`` raised for a syntax error in Python code spanning
25+
several lines of a template, such as that within a ``<% %>`` or ``<%! %>``
26+
block, is now reported against the line the error is on, rather than
27+
against the line on which the block begins. The line reported for code
28+
that occupies a single line, such as an expression or a control line, is
29+
unchanged. (:ticket:`245`)
30+
31+
* The ``SyntaxException`` raised for a tag or expression that is never
32+
closed is now reported against the line the construct begins on, rather
33+
than the point at which the search for the closing token gave up, which
34+
for an unclosed construct is the end of the template. The message of the
35+
exception is amended to indicate that the position given is where the
36+
unterminated construct begins. (:ticket:`428`)
37+
38+
39+

0 commit comments

Comments
 (0)