Mercurial > p > roundup > code
diff roundup/cgi/engine_zopetal.py @ 7999:310e19beba3e
fix: report filename if template file is invalid
A file name like .#issue.search.html causes a crash because _find
returns None not a tuple and unpacking fails.
Trap the TypeError and raise ValueError with message that includes the
basename of the file.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 26 May 2024 11:14:10 -0400 |
| parents | b8e63e65d9a8 |
| children | dff6d2edc52f |
line wrap: on
line diff
--- a/roundup/cgi/engine_zopetal.py Sun May 26 00:33:43 2024 -0400 +++ b/roundup/cgi/engine_zopetal.py Sun May 26 11:14:10 2024 -0400 @@ -22,7 +22,11 @@ def load(self, tplname): # find the source - src, filename = self._find(tplname) + try: + src, filename = self._find(tplname) + except TypeError as e: + raise ValueError("Unable to load template file basename: %s: %s" % ( + tplname, e)) # has it changed? try:
