Skip to content
Snippets Groups Projects
Commit 8b00bc5f authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

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

parent 216a8711
No related branches found
No related tags found
No related merge requests found
Pipeline #25886 failed
......@@ -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])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment