Skip to content

Improve logging of warnings from Jinja2 lexing - #7384

Open
MetRonnie wants to merge 1 commit into
cylc:8.6.xfrom
MetRonnie:j2-warnings
Open

Improve logging of warnings from Jinja2 lexing#7384
MetRonnie wants to merge 1 commit into
cylc:8.6.xfrom
MetRonnie:j2-warnings

Conversation

@MetRonnie

@MetRonnie MetRonnie commented Jul 17, 2026

Copy link
Copy Markdown
Member

Follow-up to #7365

Changes the apparent source of some warnings raised during jinja2 lexing from the jinja2 source code to the Cylc config file

Repro

#!jinja2
{% set x = '\${HOME}/foo/bar' %}
[scheduler]
    allow implicit tasks = True
[scheduling]
    [[graph]]
        R1 = foo

Before

$ cylc validate wflow
WARNING - The following warnings were raised during Jinja2 preprocessing (note: any Jinja 3.1 deprecations will break at Cylc 8.7):
    .../lib/python3.14/site-packages/jinja2/lexer.py:654: DeprecationWarning: "\$" is an invalid escape sequence. Such sequences will not work in the future.
      .decode("unicode-escape")

After

$ cylc validate wflow
WARNING - The following warnings were raised during Jinja2 preprocessing (note: any Jinja 3.1 deprecations will break at Cylc 8.7):
    ~/cylc-run/wflow/flow.cylc:<jinja2 template>: DeprecationWarning: "\$" is an invalid escape sequence. Such sequences will not work in the future.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • No dependency changes
  • No tests included as minor
  • Changelog entry not needed as follow-up to unreleased PR
  • No docs needed
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@MetRonnie MetRonnie added this to the 8.6.6 milestone Jul 17, 2026
@MetRonnie
MetRonnie requested a review from oliver-sanders July 17, 2026 16:21
@MetRonnie MetRonnie self-assigned this Jul 17, 2026
@MetRonnie MetRonnie added small could be better Not exactly a bug, but not ideal. labels Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

could be better Not exactly a bug, but not ideal. small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant