Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing Ert GUI gives RuntimeError: GUILogHandler has been deleted in terminal #8186

Closed
larsevj opened this issue Jun 19, 2024 · 3 comments · Fixed by #8350
Closed

Closing Ert GUI gives RuntimeError: GUILogHandler has been deleted in terminal #8186

larsevj opened this issue Jun 19, 2024 · 3 comments · Fixed by #8350
Assignees
Labels

Comments

@larsevj
Copy link
Contributor

larsevj commented Jun 19, 2024

Describe the bug
When closing the Ert GUI on macos14 arm with python3.12 you get the following error in the terminal:

Exception ignored in atexit callback: <function shutdown at 0x10435c0e0>
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/logging/__init__.py", line 2263, in shutdown
    if getattr(h, 'flushOnClose', True):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: wrapped C/C++ object of type GUILogHandler has been deleted

Does not seem to happen with python3.11, but as we run our workflow tests with python3.12 this should be looked into.

To reproduce
Steps to reproduce the behaviour:

  1. pip install ert
  2. ert gui my_config.ert
  3. Close the ert gui

Expected behaviour
Should not get this error, and investigate why this happens.

Environment

  • OS: macos14 (arm)
  • ERT/Komodo release: main and (ert 10.1.11)
  • Python version: 3.12
  • Remote/HPC execution involved: [no]
@larsevj larsevj added the bug label Jun 19, 2024
@eivindjahren eivindjahren self-assigned this Jun 26, 2024
@eivindjahren
Copy link
Contributor

This should not be possible as GuiLogHandler is created by

@contextmanager
def add_gui_log_handler() -> Iterator[GUILogHandler]:
"""
Context manager for the GUILogHandler class. Will make sure that the handler
is removed prior to program exit.
"""
logger = logging.getLogger()
handler = GUILogHandler()
logger.addHandler(handler)
yield handler
logger.removeHandler(handler)

This doesn't seem to happen with python 3.12 on ubuntu, so I suggest someone with a mac check this out.

@eivindjahren eivindjahren removed their assignment Jun 27, 2024
@larsevj
Copy link
Contributor Author

larsevj commented Jul 26, 2024

I get the same error using python3.12 on RHEL8, I have also seen the error happen on python3.12 on the ubuntu github actions runners, so seems to not be exclusively related to mac.

@eivindjahren eivindjahren self-assigned this Jul 26, 2024
@eivindjahren
Copy link
Contributor

I'll have another look then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants