• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. currentmodule:: jinja2
2
3Version 3.1.2
4-------------
5
6Released 2022-04-28
7
8-   Add parameters to ``Environment.overlay`` to match ``__init__``.
9    :issue:`1645`
10-   Handle race condition in ``FileSystemBytecodeCache``. :issue:`1654`
11
12
13Version 3.1.1
14-------------
15
16Released 2022-03-25
17
18-   The template filename on Windows uses the primary path separator.
19    :issue:`1637`
20
21
22Version 3.1.0
23-------------
24
25Released 2022-03-24
26
27-   Drop support for Python 3.6. :pr:`1534`
28-   Remove previously deprecated code. :pr:`1544`
29
30    -   ``WithExtension`` and ``AutoEscapeExtension`` are built-in now.
31    -   ``contextfilter`` and ``contextfunction`` are replaced by
32        ``pass_context``. ``evalcontextfilter`` and
33        ``evalcontextfunction`` are replaced by ``pass_eval_context``.
34        ``environmentfilter`` and ``environmentfunction`` are replaced
35        by ``pass_environment``.
36    -   ``Markup`` and ``escape`` should be imported from MarkupSafe.
37    -   Compiled templates from very old Jinja versions may need to be
38        recompiled.
39    -   Legacy resolve mode for ``Context`` subclasses is no longer
40        supported. Override ``resolve_or_missing`` instead of
41        ``resolve``.
42    -   ``unicode_urlencode`` is renamed to ``url_quote``.
43
44-   Add support for native types in macros. :issue:`1510`
45-   The ``{% trans %}`` tag can use ``pgettext`` and ``npgettext`` by
46    passing a context string as the first token in the tag, like
47    ``{% trans "title" %}``. :issue:`1430`
48-   Update valid identifier characters from Python 3.6 to 3.7.
49    :pr:`1571`
50-   Filters and tests decorated with ``@async_variant`` are pickleable.
51    :pr:`1612`
52-   Add ``items`` filter. :issue:`1561`
53-   Subscriptions (``[0]``, etc.) can be used after filters, tests, and
54    calls when the environment is in async mode. :issue:`1573`
55-   The ``groupby`` filter is case-insensitive by default, matching
56    other comparison filters. Added the ``case_sensitive`` parameter to
57    control this. :issue:`1463`
58-   Windows drive-relative path segments in template names will not
59    result in ``FileSystemLoader`` and ``PackageLoader`` loading from
60    drive-relative paths. :pr:`1621`
61
62
63Version 3.0.3
64-------------
65
66Released 2021-11-09
67
68-   Fix traceback rewriting internals for Python 3.10 and 3.11.
69    :issue:`1535`
70-   Fix how the native environment treats leading and trailing spaces
71    when parsing values on Python 3.10. :pr:`1537`
72-   Improve async performance by avoiding checks for common types.
73    :issue:`1514`
74-   Revert change to ``hash(Node)`` behavior. Nodes are hashed by id
75    again :issue:`1521`
76-   ``PackageLoader`` works when the package is a single module file.
77    :issue:`1512`
78
79
80Version 3.0.2
81-------------
82
83Released 2021-10-04
84
85-   Fix a loop scoping bug that caused assignments in nested loops
86    to still be referenced outside of it. :issue:`1427`
87-   Make ``compile_templates`` deterministic for filter and import
88    names. :issue:`1452, 1453`
89-   Revert an unintended change that caused ``Undefined`` to act like
90    ``StrictUndefined`` for the ``in`` operator. :issue:`1448`
91-   Imported macros have access to the current template globals in async
92    environments. :issue:`1494`
93-   ``PackageLoader`` will not include a current directory (.) path
94    segment. This allows loading templates from the root of a zip
95    import. :issue:`1467`
96
97
98Version 3.0.1
99-------------
100
101Released 2021-05-18
102
103-   Update MarkupSafe dependency to >= 2.0. :pr:`1418`
104-   Mark top-level names as exported so type checking understands
105    imports in user projects. :issue:`1426`
106-   Fix some types that weren't available in Python 3.6.0. :issue:`1433`
107-   The deprecation warning for unneeded ``autoescape`` and ``with_``
108    extensions shows more relevant context. :issue:`1429`
109-   Fixed calling deprecated ``jinja2.Markup`` without an argument.
110    Use ``markupsafe.Markup`` instead. :issue:`1438`
111-   Calling sync ``render`` for an async template uses ``asyncio.run``
112    on Python >= 3.7. This fixes a deprecation that Python 3.10
113    introduces. :issue:`1443`
114
115
116Version 3.0.0
117-------------
118
119Released 2021-05-11
120
121-   Drop support for Python 2.7 and 3.5.
122-   Bump MarkupSafe dependency to >=1.1.
123-   Bump Babel optional dependency to >=2.1.
124-   Remove code that was marked deprecated.
125-   Add type hinting. :pr:`1412`
126-   Use :pep:`451` API to load templates with
127    :class:`~loaders.PackageLoader`. :issue:`1168`
128-   Fix a bug that caused imported macros to not have access to the
129    current template's globals. :issue:`688`
130-   Add ability to ignore ``trim_blocks`` using ``+%}``. :issue:`1036`
131-   Fix a bug that caused custom async-only filters to fail with
132    constant input. :issue:`1279`
133-   Fix UndefinedError incorrectly being thrown on an undefined variable
134    instead of ``Undefined`` being returned on
135    ``NativeEnvironment`` on Python 3.10. :issue:`1335`
136-   Blocks can be marked as ``required``. They must be overridden at
137    some point, but not necessarily by the direct child. :issue:`1147`
138-   Deprecate the ``autoescape`` and ``with`` extensions, they are
139    built-in to the compiler. :issue:`1203`
140-   The ``urlize`` filter recognizes ``mailto:`` links and takes
141    ``extra_schemes`` (or ``env.policies["urlize.extra_schemes"]``) to
142    recognize other schemes. It tries to balance parentheses within a
143    URL instead of ignoring trailing characters. The parsing in general
144    has been updated to be more efficient and match more cases. URLs
145    without a scheme are linked as ``https://`` instead of ``http://``.
146    :issue:`522, 827, 1172`, :pr:`1195`
147-   Filters that get attributes, such as ``map`` and ``groupby``, can
148    use a false or empty value as a default. :issue:`1331`
149-   Fix a bug that prevented variables set in blocks or loops from
150    being accessed in custom context functions. :issue:`768`
151-   Fix a bug that caused scoped blocks from accessing special loop
152    variables. :issue:`1088`
153-   Update the template globals when calling
154    ``Environment.get_template(globals=...)`` even if the template was
155    already loaded. :issue:`295`
156-   Do not raise an error for undefined filters in unexecuted
157    if-statements and conditional expressions. :issue:`842`
158-   Add ``is filter`` and ``is test`` tests to test if a name is a
159    registered filter or test. This allows checking if a filter is
160    available in a template before using it. Test functions can be
161    decorated with ``@pass_environment``, ``@pass_eval_context``,
162    or ``@pass_context``. :issue:`842`, :pr:`1248`
163-   Support ``pgettext`` and ``npgettext`` (message contexts) in i18n
164    extension. :issue:`441`
165-   The ``|indent`` filter's ``width`` argument can be a string to
166    indent by. :pr:`1167`
167-   The parser understands hex, octal, and binary integer literals.
168    :issue:`1170`
169-   ``Undefined.__contains__`` (``in``) raises an ``UndefinedError``
170    instead of a ``TypeError``. :issue:`1198`
171-   ``Undefined`` is iterable in an async environment. :issue:`1294`
172-   ``NativeEnvironment`` supports async mode. :issue:`1362`
173-   Template rendering only treats ``\n``, ``\r\n`` and ``\r`` as line
174    breaks. Other characters are left unchanged. :issue:`769, 952, 1313`
175-   ``|groupby`` filter takes an optional ``default`` argument.
176    :issue:`1359`
177-   The function and filter decorators have been renamed and unified.
178    The old names are deprecated. :issue:`1381`
179
180    -   ``pass_context`` replaces ``contextfunction`` and
181        ``contextfilter``.
182    -   ``pass_eval_context`` replaces ``evalcontextfunction`` and
183        ``evalcontextfilter``
184    -   ``pass_environment`` replaces ``environmentfunction`` and
185        ``environmentfilter``.
186
187-   Async support no longer requires Jinja to patch itself. It must
188    still be enabled with ``Environment(enable_async=True)``.
189    :issue:`1390`
190-   Overriding ``Context.resolve`` is deprecated, override
191    ``resolve_or_missing`` instead. :issue:`1380`
192
193
194Version 2.11.3
195--------------
196
197Released 2021-01-31
198
199-   Improve the speed of the ``urlize`` filter by reducing regex
200    backtracking. Email matching requires a word character at the start
201    of the domain part, and only word characters in the TLD. :pr:`1343`
202
203
204Version 2.11.2
205--------------
206
207Released 2020-04-13
208
209-   Fix a bug that caused callable objects with ``__getattr__``, like
210    :class:`~unittest.mock.Mock` to be treated as a
211    :func:`contextfunction`. :issue:`1145`
212-   Update ``wordcount`` filter to trigger :class:`Undefined` methods
213    by wrapping the input in :func:`soft_str`. :pr:`1160`
214-   Fix a hang when displaying tracebacks on Python 32-bit.
215    :issue:`1162`
216-   Showing an undefined error for an object that raises
217    ``AttributeError`` on access doesn't cause a recursion error.
218    :issue:`1177`
219-   Revert changes to :class:`~loaders.PackageLoader` from 2.10 which
220    removed the dependency on setuptools and pkg_resources, and added
221    limited support for namespace packages. The changes caused issues
222    when using Pytest. Due to the difficulty in supporting Python 2 and
223    :pep:`451` simultaneously, the changes are reverted until 3.0.
224    :pr:`1182`
225-   Fix line numbers in error messages when newlines are stripped.
226    :pr:`1178`
227-   The special ``namespace()`` assignment object in templates works in
228    async environments. :issue:`1180`
229-   Fix whitespace being removed before tags in the middle of lines when
230    ``lstrip_blocks`` is enabled. :issue:`1138`
231-   :class:`~nativetypes.NativeEnvironment` doesn't evaluate
232    intermediate strings during rendering. This prevents early
233    evaluation which could change the value of an expression.
234    :issue:`1186`
235
236
237Version 2.11.1
238--------------
239
240Released 2020-01-30
241
242-   Fix a bug that prevented looking up a key after an attribute
243    (``{{ data.items[1:] }}``) in an async template. :issue:`1141`
244
245
246Version 2.11.0
247--------------
248
249Released 2020-01-27
250
251-   Drop support for Python 2.6, 3.3, and 3.4. This will be the last
252    version to support Python 2.7 and 3.5.
253-   Added a new ``ChainableUndefined`` class to support getitem and
254    getattr on an undefined object. :issue:`977`
255-   Allow ``{%+`` syntax (with NOP behavior) when ``lstrip_blocks`` is
256    disabled. :issue:`748`
257-   Added a ``default`` parameter for the ``map`` filter. :issue:`557`
258-   Exclude environment globals from
259    :func:`meta.find_undeclared_variables`. :issue:`931`
260-   Float literals can be written with scientific notation, like
261    2.56e-3. :issue:`912`, :pr:`922`
262-   Int and float literals can be written with the '_' separator for
263    legibility, like 12_345. :pr:`923`
264-   Fix a bug causing deadlocks in ``LRUCache.setdefault``. :pr:`1000`
265-   The ``trim`` filter takes an optional string of characters to trim.
266    :pr:`828`
267-   A new ``jinja2.ext.debug`` extension adds a ``{% debug %}`` tag to
268    quickly dump the current context and available filters and tests.
269    :issue:`174`, :pr:`798, 983`
270-   Lexing templates with large amounts of whitespace is much faster.
271    :issue:`857`, :pr:`858`
272-   Parentheses around comparisons are preserved, so
273    ``{{ 2 * (3 < 5) }}`` outputs "2" instead of "False".
274    :issue:`755`, :pr:`938`
275-   Add new ``boolean``, ``false``, ``true``, ``integer`` and ``float``
276    tests. :pr:`824`
277-   The environment's ``finalize`` function is only applied to the
278    output of expressions (constant or not), not static template data.
279    :issue:`63`
280-   When providing multiple paths to ``FileSystemLoader``, a template
281    can have the same name as a directory. :issue:`821`
282-   Always return :class:`Undefined` when omitting the ``else`` clause
283    in a ``{{ 'foo' if bar }}`` expression, regardless of the
284    environment's ``undefined`` class. Omitting the ``else`` clause is a
285    valid shortcut and should not raise an error when using
286    :class:`StrictUndefined`. :issue:`710`, :pr:`1079`
287-   Fix behavior of ``loop`` control variables such as ``length`` and
288    ``revindex0`` when looping over a generator. :issue:`459, 751, 794`,
289    :pr:`993`
290-   Async support is only loaded the first time an environment enables
291    it, in order to avoid a slow initial import. :issue:`765`
292-   In async environments, the ``|map`` filter will await the filter
293    call if needed. :pr:`913`
294-   In for loops that access ``loop`` attributes, the iterator is not
295    advanced ahead of the current iteration unless ``length``,
296    ``revindex``, ``nextitem``, or ``last`` are accessed. This makes it
297    less likely to break ``groupby`` results. :issue:`555`, :pr:`1101`
298-   In async environments, the ``loop`` attributes ``length`` and
299    ``revindex`` work for async iterators. :pr:`1101`
300-   In async environments, values from attribute/property access will
301    be awaited if needed. :pr:`1101`
302-   :class:`~loader.PackageLoader` doesn't depend on setuptools or
303    pkg_resources. :issue:`970`
304-   ``PackageLoader`` has limited support for :pep:`420` namespace
305    packages. :issue:`1097`
306-   Support :class:`os.PathLike` objects in
307    :class:`~loader.FileSystemLoader` and :class:`~loader.ModuleLoader`.
308    :issue:`870`
309-   :class:`~nativetypes.NativeTemplate` correctly handles quotes
310    between expressions. ``"'{{ a }}', '{{ b }}'"`` renders as the tuple
311    ``('1', '2')`` rather than the string ``'1, 2'``. :issue:`1020`
312-   Creating a :class:`~nativetypes.NativeTemplate` directly creates a
313    :class:`~nativetypes.NativeEnvironment` instead of a default
314    :class:`Environment`. :issue:`1091`
315-   After calling ``LRUCache.copy()``, the copy's queue methods point to
316    the correct queue. :issue:`843`
317-   Compiling templates always writes UTF-8 instead of defaulting to the
318    system encoding. :issue:`889`
319-   ``|wordwrap`` filter treats existing newlines as separate paragraphs
320    to be wrapped individually, rather than creating short intermediate
321    lines. :issue:`175`
322-   Add ``break_on_hyphens`` parameter to ``|wordwrap`` filter.
323    :issue:`550`
324-   Cython compiled functions decorated as context functions will be
325    passed the context. :pr:`1108`
326-   When chained comparisons of constants are evaluated at compile time,
327    the result follows Python's behavior of returning ``False`` if any
328    comparison returns ``False``, rather than only the last one.
329    :issue:`1102`
330-   Tracebacks for exceptions in templates show the correct line numbers
331    and source for Python >= 3.7. :issue:`1104`
332-   Tracebacks for template syntax errors in Python 3 no longer show
333    internal compiler frames. :issue:`763`
334-   Add a ``DerivedContextReference`` node that can be used by
335    extensions to get the current context and local variables such as
336    ``loop``. :issue:`860`
337-   Constant folding during compilation is applied to some node types
338    that were previously overlooked. :issue:`733`
339-   ``TemplateSyntaxError.source`` is not empty when raised from an
340    included template. :issue:`457`
341-   Passing an ``Undefined`` value to ``get_template`` (such as through
342    ``extends``, ``import``, or ``include``), raises an
343    ``UndefinedError`` consistently. ``select_template`` will show the
344    undefined message in the list of attempts rather than the empty
345    string. :issue:`1037`
346-   ``TemplateSyntaxError`` can be pickled. :pr:`1117`
347
348
349Version 2.10.3
350--------------
351
352Released 2019-10-04
353
354-   Fix a typo in Babel entry point in ``setup.py`` that was preventing
355    installation.
356
357
358Version 2.10.2
359--------------
360
361Released 2019-10-04
362
363-   Fix Python 3.7 deprecation warnings.
364-   Using ``range`` in the sandboxed environment uses ``xrange`` on
365    Python 2 to avoid memory use. :issue:`933`
366-   Use Python 3.7's better traceback support to avoid a core dump when
367    using debug builds of Python 3.7. :issue:`1050`
368
369
370Version 2.10.1
371--------------
372
373Released 2019-04-06
374
375-   ``SandboxedEnvironment`` securely handles ``str.format_map`` in
376    order to prevent code execution through untrusted format strings.
377    The sandbox already handled ``str.format``.
378
379
380Version 2.10
381------------
382
383Released 2017-11-08
384
385-   Added a new extension node called ``OverlayScope`` which can be used
386    to create an unoptimized scope that will look up all variables from
387    a derived context.
388-   Added an ``in`` test that works like the in operator. This can be
389    used in combination with ``reject`` and ``select``.
390-   Added ``previtem`` and ``nextitem`` to loop contexts, providing
391    access to the previous/next item in the loop. If such an item does
392    not exist, the value is undefined.
393-   Added ``changed(*values)`` to loop contexts, providing an easy way
394    of checking whether a value has changed since the last iteration (or
395    rather since the last call of the method)
396-   Added a ``namespace`` function that creates a special object which
397    allows attribute assignment using the ``set`` tag. This can be used
398    to carry data across scopes, e.g. from a loop body to code that
399    comes after the loop.
400-   Added a ``trimmed`` modifier to ``{% trans %}`` to strip linebreaks
401    and surrounding whitespace. Also added a new policy to enable this
402    for all ``trans`` blocks.
403-   The ``random`` filter is no longer incorrectly constant folded and
404    will produce a new random choice each time the template is rendered.
405    :pr:`478`
406-   Added a ``unique`` filter. :pr:`469`
407-   Added ``min`` and ``max`` filters. :pr:`475`
408-   Added tests for all comparison operators: ``eq``, ``ne``, ``lt``,
409    ``le``, ``gt``, ``ge``. :pr:`665`
410-   ``import`` statement cannot end with a trailing comma. :pr:`617`,
411    :pr:`618`
412-   ``indent`` filter will not indent blank lines by default. :pr:`685`
413-   Add ``reverse`` argument for ``dictsort`` filter. :pr:`692`
414-   Add a ``NativeEnvironment`` that renders templates to native Python
415    types instead of strings. :pr:`708`
416-   Added filter support to the block ``set`` tag. :pr:`489`
417-   ``tojson`` filter marks output as safe to match documented behavior.
418    :pr:`718`
419-   Resolved a bug where getting debug locals for tracebacks could
420    modify template context.
421-   Fixed a bug where having many ``{% elif ... %}`` blocks resulted in
422    a "too many levels of indentation" error. These blocks now compile
423    to native ``elif ..:`` instead of ``else: if ..:`` :issue:`759`
424
425
426Version 2.9.6
427-------------
428
429Released 2017-04-03
430
431-   Fixed custom context behavior in fast resolve mode :issue:`675`
432
433
434Version 2.9.5
435-------------
436
437Released 2017-01-28
438
439-   Restored the original repr of the internal ``_GroupTuple`` because
440    this caused issues with ansible and it was an unintended change.
441    :issue:`654`
442-   Added back support for custom contexts that override the old
443    ``resolve`` method since it was hard for people to spot that this
444    could cause a regression.
445-   Correctly use the buffer for the else block of for loops. This
446    caused invalid syntax errors to be caused on 2.x and completely
447    wrong behavior on Python 3 :issue:`669`
448-   Resolve an issue where the ``{% extends %}`` tag could not be used
449    with async environments. :issue:`668`
450-   Reduce memory footprint slightly by reducing our unicode database
451    dump we use for identifier matching on Python 3 :issue:`666`
452-   Fixed autoescaping not working for macros in async compilation mode.
453    :issue:`671`
454
455
456Version 2.9.4
457-------------
458
459Released 2017-01-10
460
461-   Solved some warnings for string literals. :issue:`646`
462-   Increment the bytecode cache version which was not done due to an
463    oversight before.
464-   Corrected bad code generation and scoping for filtered loops.
465    :issue:`649`
466-   Resolved an issue where top-level output silencing after known
467    extend blocks could generate invalid code when blocks where
468    contained in if statements. :issue:`651`
469-   Made the ``truncate.leeway`` default configurable to improve
470    compatibility with older templates.
471
472
473Version 2.9.3
474-------------
475
476Released 2017-01-08
477
478-   Restored the use of blocks in macros to the extend that was possible
479    before. On Python 3 it would render a generator repr instead of the
480    block contents. :issue:`645`
481-   Set a consistent behavior for assigning of variables in inner scopes
482    when the variable is also read from an outer scope. This now sets
483    the intended behavior in all situations however it does not restore
484    the old behavior where limited assignments to outer scopes was
485    possible. For more information and a discussion see :issue:`641`
486-   Resolved an issue where ``block scoped`` would not take advantage of
487    the new scoping rules. In some more exotic cases a variable
488    overridden in a local scope would not make it into a block.
489-   Change the code generation of the ``with`` statement to be in line
490    with the new scoping rules. This resolves some unlikely bugs in edge
491    cases. This also introduces a new internal ``With`` node that can be
492    used by extensions.
493
494
495Version 2.9.2
496-------------
497
498Released 2017-01-08
499
500-   Fixed a regression that caused for loops to not be able to use the
501    same variable for the target as well as source iterator.
502    :issue:`640`
503-   Add support for a previously unknown behavior of macros. It used to
504    be possible in some circumstances to explicitly provide a caller
505    argument to macros. While badly buggy and unintended it turns out
506    that this is a common case that gets copy pasted around. To not
507    completely break backwards compatibility with the most common cases
508    it's now possible to provide an explicit keyword argument for caller
509    if it's given an explicit default. :issue:`642`
510
511
512Version 2.9.1
513-------------
514
515Released 2017-01-07
516
517-   Resolved a regression with call block scoping for macros. Nested
518    caller blocks that used the same identifiers as outer macros could
519    refer to the wrong variable incorrectly.
520
521
522Version 2.9
523-----------
524
525Released 2017-01-07, codename Derivation
526
527-   Change cache key definition in environment. This fixes a performance
528    regression introduced in 2.8.
529-   Added support for ``generator_stop`` on supported Python versions
530    (Python 3.5 and later)
531-   Corrected a long standing issue with operator precedence of math
532    operations not being what was expected.
533-   Added support for Python 3.6 async iterators through a new async
534    mode.
535-   Added policies for filter defaults and similar things.
536-   Urlize now sets "rel noopener" by default.
537-   Support attribute fallback for old-style classes in 2.x.
538-   Support toplevel set statements in extend situations.
539-   Restored behavior of Cycler for Python 3 users.
540-   Subtraction now follows the same behavior as other operators on
541    undefined values.
542-   ``map`` and friends will now give better error messages if you
543    forgot to quote the parameter.
544-   Depend on MarkupSafe 0.23 or higher.
545-   Improved the ``truncate`` filter to support better truncation in
546    case the string is barely truncated at all.
547-   Change the logic for macro autoescaping to be based on the runtime
548    autoescaping information at call time instead of macro define time.
549-   Ported a modified version of the ``tojson`` filter from Flask to
550    Jinja and hooked it up with the new policy framework.
551-   Block sets are now marked ``safe`` by default.
552-   On Python 2 the asciification of ASCII strings can now be disabled
553    with the ``compiler.ascii_str`` policy.
554-   Tests now no longer accept an arbitrary expression as first argument
555    but a restricted one. This means that you can now properly use
556    multiple tests in one expression without extra parentheses. In
557    particular you can now write ``foo is divisibleby 2 or foo is
558    divisibleby 3`` as you would expect.
559-   Greatly changed the scoping system to be more consistent with what
560    template designers and developers expect. There is now no more magic
561    difference between the different include and import constructs.
562    Context is now always propagated the same way. The only remaining
563    differences is the defaults for ``with context`` and ``without
564    context``.
565-   The ``with`` and ``autoescape`` tags are now built-in.
566-   Added the new ``select_autoescape`` function which helps configuring
567    better autoescaping easier.
568-   Fixed a runtime error in the sandbox when attributes of async
569    generators were accessed.
570
571
572Version 2.8.1
573-------------
574
575Released 2016-12-29
576
577-   Fixed the ``for_qs`` flag for ``urlencode``.
578-   Fixed regression when applying ``int`` to non-string values.
579-   SECURITY: if the sandbox mode is used format expressions are now
580    sandboxed with the same rules as in Jinja. This solves various
581    information leakage problems that can occur with format strings.
582
583
584Version 2.8
585-----------
586
587Released 2015-07-26, codename Replacement
588
589-   Added ``target`` parameter to urlize function.
590-   Added support for ``followsymlinks`` to the file system loader.
591-   The truncate filter now counts the length.
592-   Added equalto filter that helps with select filters.
593-   Changed cache keys to use absolute file names if available instead
594    of load names.
595-   Fixed loop length calculation for some iterators.
596-   Changed how Jinja enforces strings to be native strings in Python 2
597    to work when people break their default encoding.
598-   Added ``make_logging_undefined`` which returns an undefined
599    object that logs failures into a logger.
600-   If unmarshalling of cached data fails the template will be reloaded
601    now.
602-   Implemented a block ``set`` tag.
603-   Default cache size was increased to 400 from a low 50.
604-   Fixed ``is number`` test to accept long integers in all Python
605    versions.
606-   Changed ``is number`` to accept Decimal as a number.
607-   Added a check for default arguments followed by non-default
608    arguments. This change makes ``{% macro m(x, y=1, z) %}`` a syntax
609    error. The previous behavior for this code was broken anyway
610    (resulting in the default value being applied to ``y``).
611-   Add ability to use custom subclasses of
612    ``jinja2.compiler.CodeGenerator`` and ``jinja2.runtime.Context`` by
613    adding two new attributes to the environment
614    (``code_generator_class`` and ``context_class``). :pr:`404`
615-   Added support for context/environment/evalctx decorator functions on
616    the finalize callback of the environment.
617-   Escape query strings for urlencode properly. Previously slashes were
618    not escaped in that place.
619-   Add 'base' parameter to 'int' filter.
620
621
622Version 2.7.3
623-------------
624
625Released 2014-06-06
626
627-   Security issue: Corrected the security fix for the cache folder.
628    This fix was provided by RedHat.
629
630
631Version 2.7.2
632-------------
633
634Released 2014-01-10
635
636-   Prefix loader was not forwarding the locals properly to inner
637    loaders. This is now fixed.
638-   Security issue: Changed the default folder for the filesystem cache
639    to be user specific and read and write protected on UNIX systems.
640    See `Debian bug 734747`_ for more information.
641
642.. _Debian bug 734747: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734747
643
644
645Version 2.7.1
646-------------
647
648Released 2013-08-07
649
650-   Fixed a bug with ``call_filter`` not working properly on environment
651    and context filters.
652-   Fixed lack of Python 3 support for bytecode caches.
653-   Reverted support for defining blocks in included templates as this
654    broke existing templates for users.
655-   Fixed some warnings with hashing of undefineds and nodes if Python
656    is run with warnings for Python 3.
657-   Added support for properly hashing undefined objects.
658-   Fixed a bug with the title filter not working on already uppercase
659    strings.
660
661
662Version 2.7
663-----------
664
665Released 2013-05-20, codename Translation
666
667-   Choice and prefix loaders now dispatch source and template lookup
668    separately in order to work in combination with module loaders as
669    advertised.
670-   Fixed filesizeformat.
671-   Added a non-silent option for babel extraction.
672-   Added ``urlencode`` filter that automatically quotes values for URL
673    safe usage with utf-8 as only supported encoding. If applications
674    want to change this encoding they can override the filter.
675-   Added ``keep-trailing-newline`` configuration to environments and
676    templates to optionally preserve the final trailing newline.
677-   Accessing ``last`` on the loop context no longer causes the iterator
678    to be consumed into a list.
679-   Python requirement changed: 2.6, 2.7 or >= 3.3 are required now,
680    supported by same source code, using the "six" compatibility
681    library.
682-   Allow ``contextfunction`` and other decorators to be applied to
683    ``__call__``.
684-   Added support for changing from newline to different signs in the
685    ``wordwrap`` filter.
686-   Added support for ignoring memcache errors silently.
687-   Added support for keeping the trailing newline in templates.
688-   Added finer grained support for stripping whitespace on the left
689    side of blocks.
690-   Added ``map``, ``select``, ``reject``, ``selectattr`` and
691    ``rejectattr`` filters.
692-   Added support for ``loop.depth`` to figure out how deep inside a
693    recursive loop the code is.
694-   Disabled py_compile for pypy and python 3.
695
696
697Version 2.6
698-----------
699
700Released 2011-07-24, codename Convolution
701
702-   Internal attributes now raise an internal attribute error now
703    instead of returning an undefined. This fixes problems when passing
704    undefined objects to Python semantics expecting APIs.
705-   Traceback support now works properly for PyPy. (Tested with 1.4)
706-   Implemented operator intercepting for sandboxed environments. This
707    allows application developers to disable builtin operators for
708    better security. (For instance limit the mathematical operators to
709    actual integers instead of longs)
710-   Groupby filter now supports dotted notation for grouping by
711    attributes of attributes.
712-   Scoped blocks now properly treat toplevel assignments and imports.
713    Previously an import suddenly "disappeared" in a scoped block.
714-   Automatically detect newer Python interpreter versions before
715    loading code from bytecode caches to prevent segfaults on invalid
716    opcodes. The segfault in earlier Jinja versions here was not a
717    Jinja bug but a limitation in the underlying Python interpreter. If
718    you notice Jinja segfaulting in earlier versions after an upgrade
719    of the Python interpreter you don't have to upgrade, it's enough to
720    flush the bytecode cache. This just no longer makes this necessary,
721    Jinja will automatically detect these cases now.
722-   The sum filter can now sum up values by attribute. This is a
723    backwards incompatible change. The argument to the filter previously
724    was the optional starting index which defaults to zero. This now
725    became the second argument to the function because it's rarely used.
726-   Like sum, sort now also makes it possible to order items by
727    attribute.
728-   Like sum and sort, join now also is able to join attributes of
729    objects as string.
730-   The internal eval context now has a reference to the environment.
731-   Added a mapping test to see if an object is a dict or an object with
732    a similar interface.
733
734
735Version 2.5.5
736-------------
737
738Released 2010-10-18
739
740-   Built documentation is no longer part of release.
741
742
743Version 2.5.4
744-------------
745
746Released 2010-10-17
747
748-   Fixed extensions not loading properly with overlays.
749-   Work around a bug in cpython for the debugger that causes segfaults
750    on 64bit big-endian architectures.
751
752
753Version 2.5.3
754-------------
755
756Released 2010-10-17
757
758-   Fixed an operator precedence error introduced in 2.5.2. Statements
759    like "-foo.bar" had their implicit parentheses applied around the
760    first part of the expression ("(-foo).bar") instead of the more
761    correct "-(foo.bar)".
762
763
764Version 2.5.2
765-------------
766
767Released 2010-08-18
768
769-   Improved setup.py script to better work with assumptions people
770    might still have from it (``--with-speedups``).
771-   Fixed a packaging error that excluded the new debug support.
772
773
774Version 2.5.1
775-------------
776
777Released 2010-08-17
778
779-   StopIteration exceptions raised by functions called from templates
780    are now intercepted and converted to undefineds. This solves a lot
781    of debugging grief. (StopIteration is used internally to abort
782    template execution)
783-   Improved performance of macro calls slightly.
784-   Babel extraction can now properly extract newstyle gettext calls.
785-   Using the variable ``num`` in newstyle gettext for something else
786    than the pluralize count will no longer raise a :exc:`KeyError`.
787-   Removed builtin markup class and switched to markupsafe. For
788    backwards compatibility the pure Python implementation still exists
789    but is pulled from markupsafe by the Jinja developers. The debug
790    support went into a separate feature called "debugsupport" and is
791    disabled by default because it is only relevant for Python 2.4
792-   Fixed an issue with unary operators having the wrong precedence.
793
794
795Version 2.5
796-----------
797
798Released 2010-05-29, codename Incoherence
799
800-   Improved the sort filter (should have worked like this for a long
801    time) by adding support for case insensitive searches.
802-   Fixed a bug for getattribute constant folding.
803-   Support for newstyle gettext translations which result in a nicer
804    in-template user interface and more consistent catalogs.
805-   It's now possible to register extensions after an environment was
806    created.
807
808
809Version 2.4.1
810-------------
811
812Released 2010-04-20
813
814-   Fixed an error reporting bug for undefined.
815
816
817Version 2.4
818-----------
819
820Released 2010-04-13, codename Correlation
821
822-   The environment template loading functions now transparently pass
823    through a template object if it was passed to it. This makes it
824    possible to import or extend from a template object that was passed
825    to the template.
826-   Added a ``ModuleLoader`` that can load templates from
827    precompiled sources. The environment now features a method to
828    compile the templates from a configured loader into a zip file or
829    folder.
830-   The _speedups C extension now supports Python 3.
831-   Added support for autoescaping toggling sections and support for
832    evaluation contexts.
833-   Extensions have a priority now.
834
835
836Version 2.3.1
837-------------
838
839Released 2010-02-19
840
841-   Fixed an error reporting bug on all python versions
842-   Fixed an error reporting bug on Python 2.4
843
844
845Version 2.3
846-----------
847
848Released 2010-02-10, codename 3000 Pythons
849
850-   Fixes issue with code generator that causes unbound variables to be
851    generated if set was used in if-blocks and other small identifier
852    problems.
853-   Include tags are now able to select between multiple templates and
854    take the first that exists, if a list of templates is given.
855-   Fixed a problem with having call blocks in outer scopes that have an
856    argument that is also used as local variable in an inner frame
857    :issue:`360`.
858-   Greatly improved error message reporting :pr:`339`
859-   Implicit tuple expressions can no longer be totally empty. This
860    change makes ``{% if %}`` a syntax error now. :issue:`364`
861-   Added support for translator comments if extracted via babel.
862-   Added with-statement extension.
863-   Experimental Python 3 support.
864
865
866Version 2.2.1
867-------------
868
869Released 2009-09-14
870
871-   Fixes some smaller problems for Jinja on Jython.
872
873
874Version 2.2
875-----------
876
877Released 2009-09-13, codename Kong
878
879-   Include statements can now be marked with ``ignore missing`` to skip
880    non existing templates.
881-   Priority of ``not`` raised. It's now possible to write ``not foo in
882    bar`` as an alias to ``foo not in bar`` like in python. Previously
883    the grammar required parentheses (``not (foo in bar)``) which was
884    odd.
885-   Fixed a bug that caused syntax errors when defining macros or using
886    the ``{% call %}`` tag inside loops.
887-   Fixed a bug in the parser that made ``{{ foo[1, 2] }}`` impossible.
888-   Made it possible to refer to names from outer scopes in included
889    templates that were unused in the callers frame :issue:`327`
890-   Fixed a bug that caused internal errors if names where used as
891    iteration variable and regular variable *after* the loop if that
892    variable was unused *before* the loop. :pr:`331`
893-   Added support for optional ``scoped`` modifier to blocks.
894-   Added support for line-comments.
895-   Added the ``meta`` module.
896-   Renamed (undocumented) attribute "overlay" to "overlayed" on the
897    environment because it was clashing with a method of the same name.
898-   Speedup extension is now disabled by default.
899
900
901Version 2.1.1
902-------------
903
904Released 2008-12-25
905
906-   Fixed a translation error caused by looping over empty recursive
907    loops.
908
909
910Version 2.1
911-----------
912
913Released 2008-11-23, codename Yasuzō
914
915-   Fixed a bug with nested loops and the special loop variable. Before
916    the change an inner loop overwrote the loop variable from the outer
917    one after iteration.
918-   Fixed a bug with the i18n extension that caused the explicit
919    pluralization block to look up the wrong variable.
920-   Fixed a limitation in the lexer that made ``{{ foo.0.0 }}``
921    impossible.
922-   Index based subscribing of variables with a constant value returns
923    an undefined object now instead of raising an index error. This was
924    a bug caused by eager optimizing.
925-   The i18n extension looks up ``foo.ugettext`` now followed by
926    ``foo.gettext`` if an translations object is installed. This makes
927    dealing with custom translations classes easier.
928-   Fixed a confusing behavior with conditional extending. loops were
929    partially executed under some conditions even though they were not
930    part of a visible area.
931-   Added ``sort`` filter that works like ``dictsort`` but for arbitrary
932    sequences.
933-   Fixed a bug with empty statements in macros.
934-   Implemented a bytecode cache system.
935-   The template context is now weakref-able
936-   Inclusions and imports "with context" forward all variables now, not
937    only the initial context.
938-   Added a cycle helper called ``cycler``.
939-   Added a joining helper called ``joiner``.
940-   Added a ``compile_expression`` method to the environment that allows
941    compiling of Jinja expressions into callable Python objects.
942-   Fixed an escaping bug in urlize
943
944
945Version 2.0
946-----------
947
948Released 2008-07-17, codename Jinjavitus
949
950-   The subscribing of objects (looking up attributes and items) changed
951    from slightly. It's now possible to give attributes or items a
952    higher priority by either using dot-notation lookup or the bracket
953    syntax. This also changed the AST slightly. ``Subscript`` is gone
954    and was replaced with ``Getitem`` and ``Getattr``.
955-   Added support for preprocessing and token stream filtering for
956    extensions. This would allow extensions to allow simplified gettext
957    calls in template data and something similar.
958-   Added ``TemplateStream.dump``.
959-   Added missing support for implicit string literal concatenation.
960    ``{{ "foo" "bar" }}`` is equivalent to ``{{ "foobar" }}``
961-   ``else`` is optional for conditional expressions. If not given it
962    evaluates to ``false``.
963-   Improved error reporting for undefined values by providing a
964    position.
965-   ``filesizeformat`` filter uses decimal prefixes now per default and
966    can be set to binary mode with the second parameter.
967-   Fixed bug in finalizer
968
969
970Version 2.0rc1
971--------------
972
973Released 2008-06-09
974
975-   First release of Jinja 2.
976