blob: 477721f24faf0720460b448446e81dc8aae07408 [file] [log] [blame]
David Lord989a7db2018-02-06 07:48:10 -08001.. currentmodule:: jinja2
2
David Lordaaf13a22019-10-13 06:40:54 -07003Version 2.11.0
4--------------
David Lordb2dd36b2017-11-08 12:01:29 -08005
David Lord9550dc82019-07-26 15:21:16 -07006Unreleased
David Lordb2dd36b2017-11-08 12:01:29 -08007
David Lord9550dc82019-07-26 15:21:16 -07008- Async support is only loaded the first time an
9 :class:`~environment.Environment` enables it, in order to avoid a
10 slow initial import. :issue:`765`
11- Python 2.6 and 3.3 are not supported anymore.
12- The ``map`` filter in async mode now automatically awaits
13- Added a new ``ChainableUndefined`` class to support getitem and
14 getattr on an undefined object. :issue:`977`
15- Allow ``{%+`` syntax (with NOP behavior) when ``lstrip_blocks`` is
16 disabled. :issue:`748`
17- Added a ``default`` parameter for the ``map`` filter. :issue:`557`
Brendanf7b110c2019-05-07 12:00:06 -040018- Exclude environment globals from
David Lord9550dc82019-07-26 15:21:16 -070019 :func:`meta.find_undeclared_variables`. :issue:`931`
David Lord483b62e2019-07-23 08:19:51 -070020- Float literals can be written with scientific notation, like
David Lord9550dc82019-07-26 15:21:16 -070021 2.56e-3. :issue:`912`, :pr:`922`
David Lord733851e2019-07-23 11:07:09 -070022- Int and float literals can be written with the '_' separator for
David Lord9550dc82019-07-26 15:21:16 -070023 legibility, like 12_345. :pr:`923`
EtiennePelletier065b58f2019-05-09 16:47:54 -040024- Fix a bug causing deadlocks in ``LRUCache.setdefault``. :pr:`1000`
Matteo Ferrando9a5d5222018-03-21 12:47:46 -040025- The ``trim`` filter takes an optional string of characters to trim.
26 :pr:`828`
David Lord5e645ab2019-10-04 19:00:11 -070027- A new ``jinja2.ext.debug`` extension adds a ``{% debug %}`` tag to
28 quickly dump the current context and available filters and tests.
29 :issue:`174`, :pr:`798, 983`
David Lordc8b1b022019-10-06 23:42:36 -070030- Lexing templates with large amounts of whitespace is much faster.
31 :issue:`857`, :pr:`858`
David Lord0a4dad62019-10-07 07:42:04 -070032- Parentheses around comparisons are preserved, so
33 ``{{ 2 * (3 < 5) }}`` outputs "2" instead of "False".
34 :issue:`755`, :pr:`938`
Dag Wieers9bd3cb22018-03-17 04:00:11 +010035- Add new ``boolean``, ``false``, ``true``, ``integer`` and ``float``
36 tests. :pr:`824`
David Lord719537a2019-10-12 21:04:31 -070037- The environment's ``finalize`` function is only applied to the
38 output of expressions (constant or not), not static template data.
39 :issue:`63`
David Lordaaf13a22019-10-13 06:40:54 -070040- When providing multiple paths to ``FileSystemLoader``, a template
41 can have the same name as a directory. :issue:`821`
David Lord468b2df2019-10-14 07:03:03 -070042- Always return :class:`Undefined` when omitting the ``else`` clause
43 in a ``{{ 'foo' if bar }}`` expression, regardless of the
44 environment's ``undefined`` class. Omitting the ``else`` clause is a
45 valid shortcut and should not raise an error when using
46 :class:`StrictUndefined`). :issue:`710`, :pr:`1079`
aayushuppalef1a4c62019-05-06 17:17:43 -040047- Fix behavior of ``loop`` control variables such as ``length`` and
48 ``revindex0`` when looping over a generator. :issue:`459, 751, 794`,
49 :pr:`993`
David Lord4b6077a2019-10-16 13:23:36 -070050- ``PackageLoader`` doesn't depend on setuptools or pkg_resources.
51 :issue:`970`
David Lord989a7db2018-02-06 07:48:10 -080052
David Lordb2dd36b2017-11-08 12:01:29 -080053
David Lordc6a71f92019-10-04 11:50:02 -070054Version 2.10.3
55--------------
56
Josh Hollandb5adc652019-10-04 20:38:17 +010057Released 2019-10-04
David Lordc6a71f92019-10-04 11:50:02 -070058
59- Fix a typo in Babel entry point in ``setup.py`` that was preventing
60 installation.
61
62
Juan Barreneche4b1cae92019-06-18 10:51:55 -030063Version 2.10.2
64--------------
65
David Lord0fee4092019-10-04 11:18:56 -070066Released 2019-10-04
Juan Barreneche4b1cae92019-06-18 10:51:55 -030067
Prakhar Bhandari35fcd9f2019-05-06 12:00:53 -040068- Fix Python 3.7 deprecation warnings.
69- Using ``range`` in the sandboxed environment uses ``xrange`` on
David Lord288dd422019-07-26 14:57:58 -070070 Python 2 to avoid memory use. :issue:`933`
Victor Stinner3a86ef32019-08-20 00:40:39 +020071- Use Python 3.7's better traceback support to avoid a core dump when
72 using debug builds of Python 3.7. :issue:`1050`
Armin Ronacher6173cf62017-01-08 12:01:27 +010073
74
David Lordc4c40882019-04-06 11:02:53 -070075Version 2.10.1
76--------------
77
78Released 2019-04-06
79
80- ``SandboxedEnvironment`` securely handles ``str.format_map`` in
81 order to prevent code execution through untrusted format strings.
82 The sandbox already handled ``str.format``.
83
84
Armin Ronacher5e58d432008-11-23 15:45:13 +010085Version 2.10
Armin Ronacher6173cf62017-01-08 12:01:27 +010086------------
87
David Lord288dd422019-07-26 14:57:58 -070088Released 2017-11-08
Armin Ronacher6173cf62017-01-08 12:01:27 +010089
David Lord288dd422019-07-26 14:57:58 -070090- Added a new extension node called ``OverlayScope`` which can be used
91 to create an unoptimized scope that will look up all variables from
92 a derived context.
93- Added an ``in`` test that works like the in operator. This can be
94 used in combination with ``reject`` and ``select``.
95- Added ``previtem`` and ``nextitem`` to loop contexts, providing
96 access to the previous/next item in the loop. If such an item does
97 not exist, the value is undefined.
98- Added ``changed(*values)`` to loop contexts, providing an easy way
99 of checking whether a value has changed since the last iteration (or
100 rather since the last call of the method)
101- Added a ``namespace`` function that creates a special object which
102 allows attribute assignment using the ``set`` tag. This can be used
103 to carry data across scopes, e.g. from a loop body to code that
104 comes after the loop.
105- Added a ``trimmed`` modifier to ``{% trans %}`` to strip linebreaks
106 and surrounding whitespace. Also added a new policy to enable this
107 for all ``trans`` blocks.
108- The ``random`` filter is no longer incorrectly constant folded and
109 will produce a new random choice each time the template is rendered.
110 :pr:`478`
111- Added a ``unique`` filter. :pr:`469`
112- Added ``min`` and ``max`` filters. :pr:`475`
113- Added tests for all comparison operators: ``eq``, ``ne``, ``lt``,
114 ``le``, ``gt``, ``ge``. :pr:`665`
115- ``import`` statement cannot end with a trailing comma. :pr:`617`,
116 :pr:`618`
117- ``indent`` filter will not indent blank lines by default. :pr:`685`
118- Add ``reverse`` argument for ``dictsort`` filter. :pr:`692`
119- Add a ``NativeEnvironment`` that renders templates to native Python
120 types instead of strings. :pr:`708`
121- Added filter support to the block ``set`` tag. :pr:`489`
David Lord90756da2019-07-26 14:36:55 -0700122- ``tojson`` filter marks output as safe to match documented behavior.
123 :pr:`718`
124- Resolved a bug where getting debug locals for tracebacks could
125 modify template context.
126- Fixed a bug where having many ``{% elif ... %}`` blocks resulted in
127 a "too many levels of indentation" error. These blocks now compile
128 to native ``elif ..:`` instead of ``else: if ..:`` :issue:`759`
David Lordd9d3fc32017-11-01 07:57:12 -0700129
David Lord86346972017-05-23 14:57:34 -0700130
Adrian Moennicha8a9ec22017-03-15 19:19:04 +0100131Version 2.9.6
132-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700133
David Lord90756da2019-07-26 14:36:55 -0700134Released 2017-04-03
Adrian Moennicha8a9ec22017-03-15 19:19:04 +0100135
David Lord90756da2019-07-26 14:36:55 -0700136- Fixed custom context behavior in fast resolve mode :issue:`675`
Adrian Moennicha8a9ec22017-03-15 19:19:04 +0100137
David Lordd9d3fc32017-11-01 07:57:12 -0700138
Armin Ronacher78548512017-01-12 15:53:09 +0100139Version 2.9.5
140-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700141
David Lord90756da2019-07-26 14:36:55 -0700142Released 2017-01-28
Armin Ronacher78548512017-01-12 15:53:09 +0100143
David Lord90756da2019-07-26 14:36:55 -0700144- Restored the original repr of the internal ``_GroupTuple`` because
145 this caused issues with ansible and it was an unintended change.
146 :issue:`654`
147- Added back support for custom contexts that override the old
148 ``resolve`` method since it was hard for people to spot that this
149 could cause a regression.
150- Correctly use the buffer for the else block of for loops. This
151 caused invalid syntax errors to be caused on 2.x and completely
152 wrong behavior on Python 3 :issue:`669`
153- Resolve an issue where the ``{% extends %}`` tag could not be used
154 with async environments. :issue:`668`
155- Reduce memory footprint slightly by reducing our unicode database
156 dump we use for identifier matching on Python 3 :issue:`666`
157- Fixed autoescaping not working for macros in async compilation mode.
158 :issue:`671`
Armin Ronacher78548512017-01-12 15:53:09 +0100159
David Lordd9d3fc32017-11-01 07:57:12 -0700160
Armin Ronacherbe167862017-01-08 23:40:38 +0100161Version 2.9.4
162-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700163
David Lord90756da2019-07-26 14:36:55 -0700164Released 2017-01-10
Armin Ronacherbe167862017-01-08 23:40:38 +0100165
David Lord90756da2019-07-26 14:36:55 -0700166- Solved some warnings for string literals. :issue:`646`
167- Increment the bytecode cache version which was not done due to an
168 oversight before.
169- Corrected bad code generation and scoping for filtered loops.
170 :issue:`649`
171- Resolved an issue where top-level output silencing after known
172 extend blocks could generate invalid code when blocks where
173 contained in if statements. :issue:`651`
174- Made the ``truncate.leeway`` default configurable to improve
175 compatibility with older templates.
Armin Ronacherbe167862017-01-08 23:40:38 +0100176
David Lordd9d3fc32017-11-01 07:57:12 -0700177
Armin Ronacher53e3c952017-01-08 09:41:34 +0100178Version 2.9.3
179-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700180
David Lord90756da2019-07-26 14:36:55 -0700181Released 2017-01-08
Armin Ronacher53e3c952017-01-08 09:41:34 +0100182
David Lord90756da2019-07-26 14:36:55 -0700183- Restored the use of blocks in macros to the extend that was possible
184 before. On Python 3 it would render a generator repr instead of the
185 block contents. :issue:`645`
186- Set a consistent behavior for assigning of variables in inner scopes
187 when the variable is also read from an outer scope. This now sets
188 the intended behavior in all situations however it does not restore
189 the old behavior where limited assignments to outer scopes was
190 possible. For more information and a discussion see :issue:`641`
191- Resolved an issue where ``block scoped`` would not take advantage of
192 the new scoping rules. In some more exotic cases a variable
193 overriden in a local scope would not make it into a block.
194- Change the code generation of the ``with`` statement to be in line
195 with the new scoping rules. This resolves some unlikely bugs in edge
196 cases. This also introduces a new internal ``With`` node that can be
197 used by extensions.
David Lordd9d3fc32017-11-01 07:57:12 -0700198
Armin Ronacher53e3c952017-01-08 09:41:34 +0100199
Armin Ronacher62356442017-01-08 02:16:41 +0100200Version 2.9.2
Armin Ronacherbf7b9242017-01-07 16:56:13 +0100201-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700202
David Lord90756da2019-07-26 14:36:55 -0700203Released 2017-01-08
Armin Ronachere3022522017-01-07 23:15:07 +0100204
David Lord90756da2019-07-26 14:36:55 -0700205- Fixed a regression that caused for loops to not be able to use the
206 same variable for the target as well as source iterator.
207 :issue:`640`
208- Add support for a previously unknown behavior of macros. It used to
209 be possible in some circumstances to explicitly provide a caller
210 argument to macros. While badly buggy and unintended it turns out
211 that this is a common case that gets copy pasted around. To not
212 completely break backwards compatibility with the most common cases
213 it's now possible to provide an explicit keyword argument for caller
214 if it's given an explicit default. :issue:`642`
Armin Ronachere3022522017-01-07 23:15:07 +0100215
David Lordd9d3fc32017-11-01 07:57:12 -0700216
Armin Ronachere3022522017-01-07 23:15:07 +0100217Version 2.9.1
218-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700219
David Lord90756da2019-07-26 14:36:55 -0700220Released 2017-01-07
Armin Ronacherbf7b9242017-01-07 16:56:13 +0100221
David Lord90756da2019-07-26 14:36:55 -0700222- Resolved a regression with call block scoping for macros. Nested
223 caller blocks that used the same identifiers as outer macros could
224 refer to the wrong variable incorrectly.
Armin Ronacherbf7b9242017-01-07 16:56:13 +0100225
David Lordd9d3fc32017-11-01 07:57:12 -0700226
Armin Ronachere7e14cf2016-12-27 19:52:43 +0100227Version 2.9
228-----------
229
David Lord90756da2019-07-26 14:36:55 -0700230Released 2017-01-07, codename Derivation
Armin Ronachere7e14cf2016-12-27 19:52:43 +0100231
David Lord90756da2019-07-26 14:36:55 -0700232- Change cache key definition in environment. This fixes a performance
233 regression introduced in 2.8.
234- Added support for ``generator_stop`` on supported Python versions
235 (Python 3.5 and later)
236- Corrected a long standing issue with operator precedence of math
237 operations not being what was expected.
238- Added support for Python 3.6 async iterators through a new async
239 mode.
240- Added policies for filter defaults and similar things.
241- Urlize now sets "rel noopener" by default.
242- Support attribute fallback for old-style classes in 2.x.
243- Support toplevel set statements in extend situations.
244- Restored behavior of Cycler for Python 3 users.
245- Subtraction now follows the same behavior as other operators on
246 undefined values.
247- ``map`` and friends will now give better error messages if you
248 forgot to quote the parameter.
249- Depend on MarkupSafe 0.23 or higher.
250- Improved the ``truncate`` filter to support better truncation in
251 case the string is barely truncated at all.
252- Change the logic for macro autoescaping to be based on the runtime
253 autoescaping information at call time instead of macro define time.
254- Ported a modified version of the ``tojson`` filter from Flask to
255 Jinja2 and hooked it up with the new policy framework.
256- Block sets are now marked ``safe`` by default.
257- On Python 2 the asciification of ASCII strings can now be disabled
258 with the ``compiler.ascii_str`` policy.
259- Tests now no longer accept an arbitrary expression as first argument
260 but a restricted one. This means that you can now properly use
261 multiple tests in one expression without extra parentheses. In
262 particular you can now write ``foo is divisibleby 2 or foo is
263 divisibleby 3`` as you would expect.
264- Greatly changed the scoping system to be more consistent with what
265 template designers and developers expect. There is now no more magic
266 difference between the different include and import constructs.
267 Context is now always propagated the same way. The only remaining
268 differences is the defaults for ``with context`` and ``without
269 context``.
270- The ``with`` and ``autoescape`` tags are now built-in.
271- Added the new ``select_autoescape`` function which helps configuring
272 better autoescaping easier.
273- Fixed a runtime error in the sandbox when attributes of async
274 generators were accessed.
Armin Ronacher74bd64e2016-12-29 16:01:35 +0100275
David Lordd9d3fc32017-11-01 07:57:12 -0700276
Armin Ronacherf51862d2015-11-20 10:04:20 +0100277Version 2.8.1
278-------------
279
David Lord90756da2019-07-26 14:36:55 -0700280Released 2016-12-29
Armin Ronacherf51862d2015-11-20 10:04:20 +0100281
David Lord90756da2019-07-26 14:36:55 -0700282- Fixed the ``for_qs`` flag for ``urlencode``.
283- Fixed regression when applying ``int`` to non-string values.
284- SECURITY: if the sandbox mode is used format expressions are now
285 sandboxed with the same rules as in Jinja. This solves various
286 information leakage problems that can occur with format strings.
Armin Ronacher8189d212015-11-20 10:05:12 +0100287
David Lordd9d3fc32017-11-01 07:57:12 -0700288
Armin Ronacher853d8652013-12-12 22:26:29 +0000289Version 2.8
290-----------
David Lordd9d3fc32017-11-01 07:57:12 -0700291
David Lord90756da2019-07-26 14:36:55 -0700292Released 2015-07-26, codename Replacement
Armin Ronacher853d8652013-12-12 22:26:29 +0000293
David Lord90756da2019-07-26 14:36:55 -0700294- Added ``target`` parameter to urlize function.
295- Added support for ``followsymlinks`` to the file system loader.
296- The truncate filter now counts the length.
297- Added equalto filter that helps with select filters.
298- Changed cache keys to use absolute file names if available instead
299 of load names.
300- Fixed loop length calculation for some iterators.
301- Changed how Jinja2 enforces strings to be native strings in Python 2
302 to work when people break their default encoding.
303- Added :func:`make_logging_undefined` which returns an undefined
304 object that logs failures into a logger.
305- If unmarshalling of cached data fails the template will be reloaded
306 now.
307- Implemented a block ``set`` tag.
308- Default cache size was increased to 400 from a low 50.
309- Fixed ``is number`` test to accept long integers in all Python
310 versions.
311- Changed ``is number`` to accept Decimal as a number.
312- Added a check for default arguments followed by non-default
313 arguments. This change makes ``{% macro m(x, y=1, z) %}`` a syntax
314 error. The previous behavior for this code was broken anyway
315 (resulting in the default value being applied to ``y``).
316- Add ability to use custom subclasses of
317 ``jinja2.compiler.CodeGenerator`` and ``jinja2.runtime.Context`` by
318 adding two new attributes to the environment
319 (``code_generator_class`` and ``context_class``) (pull request
320 ``:issue:`404```).
321- Added support for context/environment/evalctx decorator functions on
322 the finalize callback of the environment.
323- Escape query strings for urlencode properly. Previously slashes were
324 not escaped in that place.
325- Add 'base' parameter to 'int' filter.
Armin Ronacher853d8652013-12-12 22:26:29 +0000326
David Lordd9d3fc32017-11-01 07:57:12 -0700327
Armin Ronacherf8bca132014-06-06 22:49:07 +0600328Version 2.7.3
329-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700330
David Lord90756da2019-07-26 14:36:55 -0700331Released 2014-06-06
Armin Ronacherf8bca132014-06-06 22:49:07 +0600332
David Lord90756da2019-07-26 14:36:55 -0700333- Security issue: Corrected the security fix for the cache folder.
334 This fix was provided by RedHat.
Armin Ronacherf8bca132014-06-06 22:49:07 +0600335
David Lordd9d3fc32017-11-01 07:57:12 -0700336
Armin Ronacherc6519c12013-08-07 15:59:07 +0100337Version 2.7.2
338-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700339
David Lord90756da2019-07-26 14:36:55 -0700340Released 2014-01-10
Armin Ronacherc6519c12013-08-07 15:59:07 +0100341
David Lord90756da2019-07-26 14:36:55 -0700342- Prefix loader was not forwarding the locals properly to inner
343 loaders. This is now fixed.
344- Security issue: Changed the default folder for the filesystem cache
345 to be user specific and read and write protected on UNIX systems.
346 See `Debian bug 734747`_ for more information.
Armin Ronacheracb672b2014-01-10 10:40:51 +0000347
David Lord06696562019-07-26 12:12:41 -0700348.. _Debian bug 734747: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734747
Armin Ronacher701e9ad2013-08-07 16:01:00 +0100349
David Lordd9d3fc32017-11-01 07:57:12 -0700350
Armin Ronacher5ca25292013-07-04 16:24:31 +0200351Version 2.7.1
352-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700353
David Lord90756da2019-07-26 14:36:55 -0700354Released 2013-08-07
Armin Ronacher5ca25292013-07-04 16:24:31 +0200355
David Lord90756da2019-07-26 14:36:55 -0700356- Fixed a bug with ``call_filter`` not working properly on environment
357 and context filters.
358- Fixed lack of Python 3 support for bytecode caches.
359- Reverted support for defining blocks in included templates as this
360 broke existing templates for users.
361- Fixed some warnings with hashing of undefineds and nodes if Python
362 is run with warnings for Python 3.
363- Added support for properly hashing undefined objects.
364- Fixed a bug with the title filter not working on already uppercase
365 strings.
Armin Ronacher5ca25292013-07-04 16:24:31 +0200366
David Lordd9d3fc32017-11-01 07:57:12 -0700367
Armin Ronacher6fa6cb02011-09-13 23:27:41 +0200368Version 2.7
369-----------
David Lordd9d3fc32017-11-01 07:57:12 -0700370
David Lord90756da2019-07-26 14:36:55 -0700371Released 2013-05-20, codename Translation
Armin Ronacher6fa6cb02011-09-13 23:27:41 +0200372
David Lord90756da2019-07-26 14:36:55 -0700373- Choice and prefix loaders now dispatch source and template lookup
374 separately in order to work in combination with module loaders as
375 advertised.
376- Fixed filesizeformat.
377- Added a non-silent option for babel extraction.
378- Added ``urlencode`` filter that automatically quotes values for URL
379 safe usage with utf-8 as only supported encoding. If applications
380 want to change this encoding they can override the filter.
381- Added ``keep-trailing-newline`` configuration to environments and
382 templates to optionally preserve the final trailing newline.
383- Accessing ``last`` on the loop context no longer causes the iterator
384 to be consumed into a list.
385- Python requirement changed: 2.6, 2.7 or >= 3.3 are required now,
386 supported by same source code, using the "six" compatibility
387 library.
388- Allow ``contextfunction`` and other decorators to be applied to
389 ``__call__``.
390- Added support for changing from newline to different signs in the
391 ``wordwrap`` filter.
392- Added support for ignoring memcache errors silently.
393- Added support for keeping the trailing newline in templates.
394- Added finer grained support for stripping whitespace on the left
395 side of blocks.
396- Added ``map``, ``select``, ``reject``, ``selectattr`` and
397 ``rejectattr`` filters.
398- Added support for ``loop.depth`` to figure out how deep inside a
399 recursive loop the code is.
400- Disabled py_compile for pypy and python 3.
Armin Ronacher6fa6cb02011-09-13 23:27:41 +0200401
David Lordd9d3fc32017-11-01 07:57:12 -0700402
Armin Ronacher44e1f562010-10-17 16:43:07 +0200403Version 2.6
404-----------
David Lordd9d3fc32017-11-01 07:57:12 -0700405
David Lord90756da2019-07-26 14:36:55 -0700406Released 2011-07-24, codename Convolution
Armin Ronacher44e1f562010-10-17 16:43:07 +0200407
David Lord90756da2019-07-26 14:36:55 -0700408- Internal attributes now raise an internal attribute error now
409 instead of returning an undefined. This fixes problems when passing
410 undefined objects to Python semantics expecting APIs.
411- Traceback support now works properly for PyPy. (Tested with 1.4)
412- Implemented operator intercepting for sandboxed environments. This
413 allows application developers to disable builtin operators for
414 better security. (For instance limit the mathematical operators to
415 actual integers instead of longs)
416- Groupby filter now supports dotted notation for grouping by
417 attributes of attributes.
418- Scoped blocks now properly treat toplevel assignments and imports.
419 Previously an import suddenly "disappeared" in a scoped block.
420- Automatically detect newer Python interpreter versions before
421 loading code from bytecode caches to prevent segfaults on invalid
422 opcodes. The segfault in earlier Jinja2 versions here was not a
423 Jinja2 bug but a limitation in the underlying Python interpreter. If
424 you notice Jinja2 segfaulting in earlier versions after an upgrade
425 of the Python interpreter you don't have to upgrade, it's enough to
426 flush the bytecode cache. This just no longer makes this necessary,
427 Jinja2 will automatically detect these cases now.
428- The sum filter can now sum up values by attribute. This is a
429 backwards incompatible change. The argument to the filter previously
430 was the optional starting index which defaults to zero. This now
431 became the second argument to the function because it's rarely used.
432- Like sum, sort now also makes it possible to order items by
433 attribute.
434- Like sum and sort, join now also is able to join attributes of
435 objects as string.
436- The internal eval context now has a reference to the environment.
437- Added a mapping test to see if an object is a dict or an object with
438 a similar interface.
Armin Ronacher6a3e95d2010-11-19 13:51:38 +0100439
David Lordd9d3fc32017-11-01 07:57:12 -0700440
Armin Ronacher11165732010-10-18 14:38:03 +0200441Version 2.5.5
442-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700443
David Lord90756da2019-07-26 14:36:55 -0700444Released 2010-10-18
Armin Ronacher11165732010-10-18 14:38:03 +0200445
David Lord90756da2019-07-26 14:36:55 -0700446- Built documentation is no longer part of release.
Armin Ronacher11165732010-10-18 14:38:03 +0200447
David Lordd9d3fc32017-11-01 07:57:12 -0700448
Armin Ronachere104f302010-10-17 16:42:26 +0200449Version 2.5.4
450-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700451
David Lord90756da2019-07-26 14:36:55 -0700452Released 2010-10-17
Armin Ronachere104f302010-10-17 16:42:26 +0200453
David Lord90756da2019-07-26 14:36:55 -0700454- Fixed extensions not loading properly with overlays.
455- Work around a bug in cpython for the debugger that causes segfaults
456 on 64bit big-endian architectures.
Armin Ronacher7b93e7e2010-10-17 16:44:19 +0200457
David Lordd9d3fc32017-11-01 07:57:12 -0700458
Armin Ronacher613912d2010-10-17 15:53:59 +0200459Version 2.5.3
460-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700461
David Lord90756da2019-07-26 14:36:55 -0700462Released 2010-10-17
Armin Ronacher613912d2010-10-17 15:53:59 +0200463
David Lord90756da2019-07-26 14:36:55 -0700464- Fixed an operator precedence error introduced in 2.5.2. Statements
465 like "-foo.bar" had their implicit parentheses applied around the
466 first part of the expression ("(-foo).bar") instead of the more
467 correct "-(foo.bar)".
Armin Ronacher613912d2010-10-17 15:53:59 +0200468
David Lordd9d3fc32017-11-01 07:57:12 -0700469
Armin Ronacher46036942010-08-18 11:10:50 +0200470Version 2.5.2
471-------------
Armin Ronacher46036942010-08-18 11:10:50 +0200472
David Lord90756da2019-07-26 14:36:55 -0700473Released 2010-08-18
474
475- Improved setup.py script to better work with assumptions people
476 might still have from it (``--with-speedups``).
477- Fixed a packaging error that excluded the new debug support.
Armin Ronacher46036942010-08-18 11:10:50 +0200478
David Lordd9d3fc32017-11-01 07:57:12 -0700479
Armin Ronacher02ea18a2010-07-01 11:30:42 +0200480Version 2.5.1
481-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700482
David Lord90756da2019-07-26 14:36:55 -0700483Released 2010-08-17
Armin Ronacher9fb60422010-06-05 14:41:34 +0200484
David Lord90756da2019-07-26 14:36:55 -0700485- StopIteration exceptions raised by functions called from templates
486 are now intercepted and converted to undefineds. This solves a lot
487 of debugging grief. (StopIteration is used internally to abort
488 template execution)
489- Improved performance of macro calls slightly.
490- Babel extraction can now properly extract newstyle gettext calls.
491- Using the variable ``num`` in newstyle gettext for something else
492 than the pluralize count will no longer raise a :exc:`KeyError`.
493- Removed builtin markup class and switched to markupsafe. For
494 backwards compatibility the pure Python implementation still exists
495 but is pulled from markupsafe by the Jinja2 developers. The debug
496 support went into a separate feature called "debugsupport" and is
497 disabled by default because it is only relevant for Python 2.4
498- Fixed an issue with unary operators having the wrong precedence.
Armin Ronacher9fb60422010-06-05 14:41:34 +0200499
David Lordd9d3fc32017-11-01 07:57:12 -0700500
Armin Ronacher4da90342010-05-29 17:35:10 +0200501Version 2.5
502-----------
David Lordd9d3fc32017-11-01 07:57:12 -0700503
David Lord90756da2019-07-26 14:36:55 -0700504Released 2010-05-29, codename Incoherence
Armin Ronacher73795492010-05-23 23:07:08 +0200505
David Lord90756da2019-07-26 14:36:55 -0700506- Improved the sort filter (should have worked like this for a long
507 time) by adding support for case insensitive searches.
508- Fixed a bug for getattribute constant folding.
509- Support for newstyle gettext translations which result in a nicer
510 in-template user interface and more consistent catalogs.
511 (:ref:`newstyle-gettext`)
512- It's now possible to register extensions after an environment was
513 created.
Armin Ronacher2ec1d2c2010-04-20 13:46:08 +0200514
David Lordd9d3fc32017-11-01 07:57:12 -0700515
Armin Ronacher800ac7f2010-04-20 13:45:11 +0200516Version 2.4.1
517-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700518
David Lord90756da2019-07-26 14:36:55 -0700519Released 2010-04-20
Armin Ronacher800ac7f2010-04-20 13:45:11 +0200520
David Lord90756da2019-07-26 14:36:55 -0700521- Fixed an error reporting bug for undefined.
Armin Ronacher27387aa2010-04-13 00:56:34 +0200522
David Lordd9d3fc32017-11-01 07:57:12 -0700523
Armin Ronacher559025a2010-02-10 02:23:56 +0100524Version 2.4
525-----------
David Lordd9d3fc32017-11-01 07:57:12 -0700526
David Lord90756da2019-07-26 14:36:55 -0700527Released 2010-04-13, codename Correlation
Armin Ronacher559025a2010-02-10 02:23:56 +0100528
David Lord90756da2019-07-26 14:36:55 -0700529- The environment template loading functions now transparently pass
530 through a template object if it was passed to it. This makes it
531 possible to import or extend from a template object that was passed
532 to the template.
533- Added a :class:`ModuleLoader` that can load templates from
534 precompiled sources. The environment now features a method to
535 compile the templates from a configured loader into a zip file or
536 folder.
537- The _speedups C extension now supports Python 3.
538- Added support for autoescaping toggling sections and support for
539 evaluation contexts (:ref:`eval-context`).
540- Extensions have a priority now.
Georg Brandl05be95a2010-02-21 17:50:32 +0100541
David Lordd9d3fc32017-11-01 07:57:12 -0700542
Armin Ronacher549f6b52010-02-19 11:09:28 +0100543Version 2.3.1
544-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700545
David Lord90756da2019-07-26 14:36:55 -0700546Released 2010-02-19
Armin Ronacher549f6b52010-02-19 11:09:28 +0100547
David Lord90756da2019-07-26 14:36:55 -0700548- Fixed an error reporting bug on all python versions
549- Fixed an error reporting bug on Python 2.4
Armin Ronacher549f6b52010-02-19 11:09:28 +0100550
David Lordd9d3fc32017-11-01 07:57:12 -0700551
Armin Ronacher31bbd9e2010-01-14 00:41:30 +0100552Version 2.3
553-----------
David Lordd9d3fc32017-11-01 07:57:12 -0700554
David Lord90756da2019-07-26 14:36:55 -0700555Released 2010-02-10, codename 3000 Pythons
Armin Ronacherf1c421d2009-09-17 00:48:41 +0200556
David Lord90756da2019-07-26 14:36:55 -0700557- Fixes issue with code generator that causes unbound variables to be
558 generated if set was used in if-blocks and other small identifier
559 problems.
560- Include tags are now able to select between multiple templates and
561 take the first that exists, if a list of templates is given.
562- Fixed a problem with having call blocks in outer scopes that have an
563 argument that is also used as local variable in an inner frame
564 :issue:`360`.
565- Greatly improved error message reporting :pr:`339`
566- Implicit tuple expressions can no longer be totally empty. This
567 change makes ``{% if %}`` a syntax error now. :issue:`364`
568- Added support for translator comments if extracted via babel.
569- Added with-statement extension.
570- Experimental Python 3 support.
Armin Ronacherf1c421d2009-09-17 00:48:41 +0200571
David Lordd9d3fc32017-11-01 07:57:12 -0700572
Armin Ronacher9e6400e2009-09-14 14:58:01 -0700573Version 2.2.1
574-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700575
David Lord90756da2019-07-26 14:36:55 -0700576Released 2009-09-14
Armin Ronacher9e6400e2009-09-14 14:58:01 -0700577
David Lord90756da2019-07-26 14:36:55 -0700578- Fixes some smaller problems for Jinja2 on Jython.
Armin Ronacher9e6400e2009-09-14 14:58:01 -0700579
David Lordd9d3fc32017-11-01 07:57:12 -0700580
Armin Ronacher37f58ce2008-12-27 13:10:38 +0100581Version 2.2
582-----------
David Lordd9d3fc32017-11-01 07:57:12 -0700583
David Lord90756da2019-07-26 14:36:55 -0700584Released 2009-09-13, codename Kong
Armin Ronacher37f58ce2008-12-27 13:10:38 +0100585
David Lord90756da2019-07-26 14:36:55 -0700586- Include statements can now be marked with ``ignore missing`` to skip
587 non existing templates.
588- Priority of ``not`` raised. It's now possible to write ``not foo in
589 bar`` as an alias to ``foo not in bar`` like in python. Previously
590 the grammar required parentheses (``not (foo in bar)``) which was
591 odd.
592- Fixed a bug that caused syntax errors when defining macros or using
593 the ``{% call %}`` tag inside loops.
594- Fixed a bug in the parser that made ``{{ foo[1, 2] }}`` impossible.
595- Made it possible to refer to names from outer scopes in included
596 templates that were unused in the callers frame :issue:`327`
597- Fixed a bug that caused internal errors if names where used as
598 iteration variable and regular variable *after* the loop if that
599 variable was unused *before* the loop. :pr:`331`
600- Added support for optional ``scoped`` modifier to blocks.
601- Added support for line-comments.
602- Added the ``meta`` module.
603- Renamed (undocumented) attribute "overlay" to "overlayed" on the
604 environment because it was clashing with a method of the same name.
605- Speedup extension is now disabled by default.
Armin Ronacher37f58ce2008-12-27 13:10:38 +0100606
David Lordd9d3fc32017-11-01 07:57:12 -0700607
Armin Ronachercebd8382008-12-25 18:33:46 +0100608Version 2.1.1
609-------------
David Lordd9d3fc32017-11-01 07:57:12 -0700610
David Lord90756da2019-07-26 14:36:55 -0700611Released 2008-12-25
Armin Ronachercebd8382008-12-25 18:33:46 +0100612
David Lord90756da2019-07-26 14:36:55 -0700613- Fixed a translation error caused by looping over empty recursive
614 loops.
Armin Ronachera22a53d2007-03-31 20:44:33 +0200615
David Lordd9d3fc32017-11-01 07:57:12 -0700616
Armin Ronacher237cdde2008-07-17 23:34:44 +0200617Version 2.1
618-----------
David Lordd9d3fc32017-11-01 07:57:12 -0700619
David Lord90756da2019-07-26 14:36:55 -0700620Released 2008-11-23, codename Yasuzō
Armin Ronacher237cdde2008-07-17 23:34:44 +0200621
David Lord90756da2019-07-26 14:36:55 -0700622- Fixed a bug with nested loops and the special loop variable. Before
623 the change an inner loop overwrote the loop variable from the outer
624 one after iteration.
625- Fixed a bug with the i18n extension that caused the explicit
626 pluralization block to look up the wrong variable.
627- Fixed a limitation in the lexer that made ``{{ foo.0.0 }}``
628 impossible.
629- Index based subscribing of variables with a constant value returns
630 an undefined object now instead of raising an index error. This was
631 a bug caused by eager optimizing.
632- The i18n extension looks up ``foo.ugettext`` now followed by
633 ``foo.gettext`` if an translations object is installed. This makes
634 dealing with custom translations classes easier.
635- Fixed a confusing behavior with conditional extending. loops were
636 partially executed under some conditions even though they were not
637 part of a visible area.
638- Added ``sort`` filter that works like ``dictsort`` but for arbitrary
639 sequences.
640- Fixed a bug with empty statements in macros.
641- Implemented a bytecode cache system. (:ref:`bytecode-cache`)
642- The template context is now weakref-able
643- Inclusions and imports "with context" forward all variables now, not
644 only the initial context.
645- Added a cycle helper called ``cycler``.
646- Added a joining helper called ``joiner``.
647- Added a ``compile_expression`` method to the environment that allows
648 compiling of Jinja expressions into callable Python objects.
649- Fixed an escaping bug in urlize
Armin Ronacherd9342dc2008-11-17 00:35:30 +0100650
David Lordd9d3fc32017-11-01 07:57:12 -0700651
Armin Ronacher9d472df2008-05-04 19:56:34 +0200652Version 2.0
Armin Ronacherc689cf12007-11-18 11:23:58 +0100653-----------
David Lordd9d3fc32017-11-01 07:57:12 -0700654
David Lord90756da2019-07-26 14:36:55 -0700655Released 2008-07-17, codename Jinjavitus
Armin Ronacherc689cf12007-11-18 11:23:58 +0100656
David Lord90756da2019-07-26 14:36:55 -0700657- The subscribing of objects (looking up attributes and items) changed
658 from slightly. It's now possible to give attributes or items a
659 higher priority by either using dot-notation lookup or the bracket
660 syntax. This also changed the AST slightly. ``Subscript`` is gone
661 and was replaced with :class:`~jinja2.nodes.Getitem` and
662 :class:`~jinja2.nodes.Getattr`. For more information see :ref:`the
663 implementation details <notes-on-subscriptions>`.
664- Added support for preprocessing and token stream filtering for
665 extensions. This would allow extensions to allow simplified gettext
666 calls in template data and something similar.
667- Added :meth:`jinja2.environment.TemplateStream.dump`.
668- Added missing support for implicit string literal concatenation.
669 ``{{ "foo" "bar" }}`` is equivalent to ``{{ "foobar" }}``
670- ``else`` is optional for conditional expressions. If not given it
671 evaluates to ``false``.
672- Improved error reporting for undefined values by providing a
673 position.
674- ``filesizeformat`` filter uses decimal prefixes now per default and
675 can be set to binary mode with the second parameter.
676- Fixed bug in finalizer
Armin Ronacher665bfb82008-07-14 13:41:46 +0200677
David Lordd9d3fc32017-11-01 07:57:12 -0700678
Armin Ronacher6dc6f292008-06-12 08:50:07 +0200679Version 2.0rc1
680--------------
David Lordd9d3fc32017-11-01 07:57:12 -0700681
David Lord90756da2019-07-26 14:36:55 -0700682Released 2008-06-09
Armin Ronacher6dc6f292008-06-12 08:50:07 +0200683
David Lord90756da2019-07-26 14:36:55 -0700684- First release of Jinja2