Mercurial > p > roundup > code
diff roundup/configuration.py @ 8451:401c6f0be6c5
bug: fix json logging config file syntax exception/fix test for windows
If the json logging config file has mimatched {} or [], it raises
an IndexError. Handle that case and test it.
Also handle embedded filenames in tests when testsare run on
windows:(/ vs \ directory sep).
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 17 Sep 2025 19:58:08 -0400 |
| parents | d06be9346c68 |
| children | e91ff70e4563 |
line wrap: on
line diff
--- a/roundup/configuration.py Wed Sep 17 01:33:09 2025 -0400 +++ b/roundup/configuration.py Wed Sep 17 19:58:08 2025 -0400 @@ -2604,7 +2604,11 @@ error_at_doc_line = e.lineno # subtract 1 - zero index on config_list # remove '\n' for display - line = config_list[error_at_doc_line - 1][:-1] + try: + line = config_list[error_at_doc_line - 1][:-1] + except IndexError: + line = _("Error found at end of file. Maybe missing a " + "block closing '}'.") hint = "" if line.find('//') != -1:
