#15031 closed enhancement (fixed)
jinja2-3.0.0 (Python module)
| Reported by: | Bruce Dubbs | Owned by: | Bruce Dubbs |
|---|---|---|---|
| Priority: | normal | Milestone: | 11.0 |
| Component: | BOOK | Version: | git |
| Severity: | medium | Keywords: | |
| Cc: |
Description
New major version.
Change History (5)
comment:1 by , 5 years ago
| Summary: | junja-2-3.0.0 (Python module) → jinja2-3.0.0 (Python module) |
|---|
comment:2 by , 5 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 5 years ago
Version 3.0.0
Released 2021-05-11
- Drop support for Python 2.7 and 3.5.
- Bump MarkupSafe dependency to >=1.1.
- Bump Babel optional dependency to >=2.1.
- Remove code that was marked deprecated.
- Add type hinting.
- Use :pep:
451API to load templates with :class:~loaders.PackageLoader. - Fix a bug that caused imported macros to not have access to the current template's globals.
- Add ability to ignore
trim_blocksusing+%}. - Fix a bug that caused custom async-only filters to fail with constant input.
- Fix UndefinedError incorrectly being thrown on an undefined variable
instead of
Undefinedbeing returned onNativeEnvironmenton Python 3.10. - Blocks can be marked as
required. They must be overridden at some point, but not necessarily by the direct child. - Deprecate the
autoescapeandwithextensions, they are built-in to the compiler.
- The
urlizefilter recognizesmailto:links and takesextra_schemes(orenv.policiesurlize.extra_schemes) to recognize other schemes. It tries to balance parentheses within a URL instead of ignoring trailing characters. The parsing in general has been updated to be more efficient and match more cases. URLs without a scheme are linked ashttps://instead ofhttp://.
- Filters that get attributes, such as
mapandgroupby, can use a false or empty value as a default. - Fix a bug that prevented variables set in blocks or loops from being accessed in custom context functions.
- Fix a bug that caused scoped blocks from accessing special loop variables.
- Update the template globals when calling
Environment.get_template(globals=...)even if the template was already loaded. - Do not raise an error for undefined filters in unexecuted if-statements and conditional expressions.
- Add
is filterandis testtests to test if a name is a registered filter or test. This allows checking if a filter is available in a template before using it. Test functions can be decorated with@pass_environment,@pass_eval_context, or@pass_context. :issue:842, - Support
pgettextandnpgettext(message contexts) in i18n extension. - The
|indentfilter'swidthargument can be a string to indent by. - The parser understands hex, octal, and binary integer literals.
Undefined.contains(in) raises anUndefinedErrorinstead of aTypeError.Undefinedis iterable in an async environment. :issue:1294NativeEnvironmentsupports async mode.- Template rendering only treats
\n,\r\nand\ras line breaks. Other characters are left unchanged. |groupbyfilter takes an optionaldefaultargument.
- The function and filter decorators have been renamed and unified.
The old names are deprecated.
pass_contextreplacescontextfunctionandcontextfilter.pass_eval_contextreplacesevalcontextfunctionandevalcontextfilterpass_environmentreplacesenvironmentfunctionandenvironmentfilter.
- Async support no longer requires Jinja to patch itself. It must
still be enabled with
Environment(enable_async=True).
- Overriding
Context.resolveis deprecated, overrideresolve_or_missinginstead.
comment:4 by , 5 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
327a2630f9 Update to sudo-1.9.7 and libXfixes-6.0.0 (Xorg Library) 6d2b973748 Update to Jinja2-3.0.0 and MarkupSafe-2.0.0 (Python modules)
Note:
See TracTickets
for help on using tickets.

Use the correct name :)