Problem
parseMetadata() in tests/database-tests.py crashes with IndexError: string index out of range when a metadata block contains a blank line.
Steps
- Create a lyrics file with a blank line inside the metadata section (after the
___ separator).
- Run
cd tests && make (or python3 database-tests.py).
Expected
Test suite parses metadata cleanly or reports a warning.
Actual
IndexError: string index out of range
at tests/database-tests.py:62:
line can be empty after line.rstrip() on line 61; line[0] then raises.
Fix
Guard with if line and line[0] == ' ': or continue on empty lines.
Env
Python 3.x, any OS. File unchanged since introduction.
Thanks for maintaining Lyrics/lyrics-database!
Problem
parseMetadata()intests/database-tests.pycrashes withIndexError: string index out of rangewhen a metadata block contains a blank line.Steps
___separator).cd tests && make(orpython3 database-tests.py).Expected
Test suite parses metadata cleanly or reports a warning.
Actual
at
tests/database-tests.py:62:linecan be empty afterline.rstrip()on line 61;line[0]then raises.Fix
Guard with
if line and line[0] == ' ':orcontinueon empty lines.Env
Python 3.x, any OS. File unchanged since introduction.
Thanks for maintaining Lyrics/lyrics-database!