ansible/changelogs
Sam Doran e75570ba83
[stable-2.10] Fix YAML error message when error is at the end of the file (#73241) (#73296)
If a YAML file fails to load due to a syntax error in a file, or there is an error in the last line of a
file, PyYAML reports the last line number of the file as the index where the error occurred.

When reading the file lines, we use that index to the get the relevant line.  If the index value is out
of range, the relevant line is lost for error reporting.

Subtract one from the index value to avoid the IndexError in this specific scenario. It is possible
to still get an IndexError, which will be handled as it is currently.

* Update existing tests and add new tests
(cherry picked from commit e8d4b62b41)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-02-07 17:56:17 -06:00
..
fragments [stable-2.10] Fix YAML error message when error is at the end of the file (#73241) (#73296) 2021-02-07 17:56:17 -06:00
CHANGELOG-v2.10.rst New release v2.10.5 2021-01-18 14:34:40 -06:00
CHANGELOG.rst
changelog.yaml New release v2.10.5 2021-01-18 14:34:40 -06:00
config.yaml Make changelog tool be more strict about suffixes (#70909) (#71135) 2020-08-21 09:33:08 -07:00