ImperialCollegeLondon / safedata_validator

Python tools to validate and publish datasets using the safedata metadata format.
https://safedata-validator.readthedocs.io/
MIT License
2 stars 4 forks source link

OS specific handling of StreamHandler streams #113

Closed davidorme closed 6 months ago

davidorme commented 6 months ago

The code for sdv.logging.StreamCounterHandler.reset currently does this:

https://github.com/ImperialCollegeLondon/safedata_validator/blob/177abd5ef793979972396cc8e018c11712d4c89d/safedata_validator/logger.py#L88-L89

The intention there was to remove contents from the stream handler from previous runs when it was running as a service behind a web server. It turns out that those lines don't work on Linux or Windows - on those platforms, this stream is not seekable and causes safedata_validate to crash.

I'm not 100% sure what is going on here but the easiest solution is simply to retire those two lines, which should fix the issue, and then fix repeated log entries if that re-emerges in practice.