Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent index out of bounds error when reading empty log file
When trying to run utt hello after manually deleting all the content in the report-file. I did this to start over. The error comes from add_entry.py on line 26. If the report-file is empty you can't put the cursor on position -1 ```python with open(filename, "rb+") as file: file.seek(-1, os.SEEK_END) # if the file is empty, position -1 will cause OSError ... ``` I fixed it by catching the exception and letting the error pass, whilst setting; prepend_new_line = False to pass integration-testing I also had to let errno.ENOENT (FileNotFound) pass without raising an Exception - If the file doesn't exist it gets created. Issue: larose#19
- Loading branch information