healthysustainablecities/global-indicators

If a log file is deleted but an output directory is not analysis will crash when attempting to append to log

carlhiggs opened this issue · 0 comments

If a log file is deleted but an output directory is not analysis will crash when attempting to append to log.

This could happen if someone has attempted to restart analysis by dropping the database and deleting contents of the output folder rather than the output folder itself.

Instead of crashing, a new log file should just be created.

The change is simple,

instead of

https://github.com/global-healthy-liveable-cities/global-indicators/blob/cc9603018854dbfce4cbc7ffb4002dd6026b75ce/process/analysis.py#L125

this should just be

a+

then if the file doesn't exist, it will be created