Skip to content

Commit

Permalink
per #2245, add METplusConfig class function that is called when objec…
Browse files Browse the repository at this point in the history
…t is deleted to close log handlers. This prevents OSError: [Errno 24] Too many open files from running all pytests
  • Loading branch information
georgemccabe committed Jul 17, 2023
1 parent 159493b commit d5ea70c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metplus/util/config_metplus.py
Expand Up @@ -462,6 +462,12 @@ def __init__(self, conf=None):
# add section to hold environment variables defined by the user
self.add_section('user_env_vars')

def __del__(self):
handlers = self.logger.handlers[:]
for handler in handlers:
self.logger.removeHandler(handler)
handler.close()

def log(self, sublog=None):
"""! Overrides method in ProdConfig
If the sublog argument is
Expand Down

0 comments on commit d5ea70c

Please sign in to comment.