Commit 8b00bc5f authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Caught 'ValueError: I/O operation on closed file'.


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 216a8711
Pipeline #25886 failed with stages
in 46 minutes and 35 seconds
......@@ -155,7 +155,11 @@ class SpecHomo_Logger(logging.Logger):
if handler.get_name() == 'StringIO handler':
self.streamObj.flush()
self.removeHandler(handler) # if not called with '[:]' the StreamHandlers are left open
handler.flush()
try:
handler.flush()
except ValueError:
# ValueError: I/O operation on closed file
pass
handler.close()
except PermissionError:
warnings.warn('Could not properly close logfile due to a PermissionError: %s' % sys.exc_info()[1])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment