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