From 31538d157880a4a22e9a8f2027dd5c21604f0a50 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 11 Nov 2024 14:43:09 +0100 Subject: [PATCH] [IMP] add information in error message Not always clear what was the issue with only the keyword --- pelican/contents.py | 3 ++- pelican/tests/test_contents.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 0769f8757..bf7b3c3fb 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -358,8 +358,9 @@ def _find_path(path: str) -> Optional[Content]: origin = joiner(siteurl, Author(path, self.settings).url) else: logger.warning( - "Replacement Indicator '%s' not recognized, skipping replacement", + "Replacement Indicator %r not recognized in %r, skipping replacement", what, + origin, ) # keep all other parts, such as query, fragment, etc. diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 06d1a6901..4defafa46 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -1036,7 +1036,7 @@ def test_unknown_link_syntax(self): self.assertEqual(content, html) self.assertLogCountEqual( count=1, - msg="Replacement Indicator 'unknown' not recognized, " + msg="Replacement Indicator 'unknown' not recognized in '{unknown}foo', " "skipping replacement", level=logging.WARNING, )