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

Using deprecated _qt_viewer causing warnings/crashes #241

Closed
ianhi opened this issue Jan 11, 2023 · 0 comments · Fixed by #254
Closed

Using deprecated _qt_viewer causing warnings/crashes #241

ianhi opened this issue Jan 11, 2023 · 0 comments · Fixed by #254

Comments

@ianhi
Copy link
Contributor

ianhi commented Jan 11, 2023

When I launch with napari -w napari-micromanager I get the following:

0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
WARNING: QMainWindowLayout::count: ?
15:59:17 WARNING QMainWindowLayout::count: ?
/home/ian/Documents/oss/micro/napari-micromanager/src/napari_micromanager/_gui_objects/_toolbar.py:119: FutureWarning: Private attribute access ('Window._qt_window') in this context (e.g. inside a plugin widget or dock widget) is deprecated and will be unavailable in version 0.5.0!
Killed

and then everything closes.

If I run things from ipython and hten open the plugin from the menu then it sometimes crashes and sometimes seems to work, but with a large number of errors:

In [1]: import napari; viewer = napari.Viewer()
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.

In [2]: WARNING: QMainWindowLayout::count: ?
/home/ian/Documents/oss/micro/napari-micromanager/src/napari_micromanager/_gui_objects/_toolbar.py:119: FutureWarning: Private attribute access ('Window._qt_window') in this context (e.g. inside a plugin widget or dock widget) is deprecated and will be unavailable in version 0.5.0
  if not (win := getattr(self.viewer.window, "_qt_window", None)):
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/IPython/core/application.py", line 287, in excepthook
    return crashhandler.crash_handler_lite(etype, evalue, tb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/IPython/core/crashhandler.py", line 226, in crash_handler_lite
    traceback.print_exception(etype, evalue, tb)
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 124, in print_exception
    te = TracebackException(type(value), value, tb, limit=limit, compact=True)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 688, in __init__
    self.stack = StackSummary._extract_from_extended_frame_gen(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 414, in _extract_from_extended_frame_gen
    result = klass()
             ^^^^^^^
RecursionError: maximum recursion depth exceeded while calling a Python object

Original exception was:
Traceback (most recent call last):
  File "/home/ian/Documents/oss/micro/napari-micromanager/src/napari_micromanager/_gui_objects/_toolbar.py", line 119, in eventFilter
    if not (win := getattr(self.viewer.window, "_qt_window", None)):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/utils/_proxies.py", line 56, in __getattr__
    trans._(
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/utils/translations.py", line 443, in _
    TranslationString(
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/utils/translations.py", line 203, in __new__
    cls._original_value(
RecursionError: maximum recursion depth exceeded
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/IPython/core/application.py", line 287, in excepthook
    return crashhandler.crash_handler_lite(etype, evalue, tb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/IPython/core/crashhandler.py", line 226, in crash_handler_lite
    traceback.print_exception(etype, evalue, tb)
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 124, in print_exception
    te = TracebackException(type(value), value, tb, limit=limit, compact=True)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 688, in __init__
    self.stack = StackSummary._extract_from_extended_frame_gen(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 414, in _extract_from_extended_frame_gen
    result = klass()
             ^^^^^^^
RecursionError: maximum recursion depth exceeded while calling a Python object

Original exception was:
Traceback (most recent call last):
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/_qt/widgets/qt_viewer_dock_widget.py", line 278, in _on_visibility_changed
    self.title = QtCustomTitleBar(
                 ^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/_qt/widgets/qt_viewer_dock_widget.py", line 314, in __init__
    self.setToolTip(trans._('drag to move. double-click to float'))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/utils/translations.py", line 447, in _
    else self._dnpgettext(msgid=msgid, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/utils/translations.py", line 398, in _dnpgettext
    translation = gettext.dgettext(self._domain, msgid)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/gettext.py", line 568, in dgettext
    t = translation(domain, _localedirs.get(domain, None))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/IPython/core/application.py", line 287, in excepthook
    return crashhandler.crash_handler_lite(etype, evalue, tb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/IPython/core/crashhandler.py", line 226, in crash_handler_lite
    traceback.print_exception(etype, evalue, tb)
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 124, in print_exception
    te = TracebackException(type(value), value, tb, limit=limit, compact=True)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 688, in __init__
    self.stack = StackSummary._extract_from_extended_frame_gen(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 416, in _extract_from_extended_frame_gen
    for f, (lineno, end_lineno, colno, end_colno) in frame_gen:
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 353, in _walk_tb_with_full_positions
    positions = _get_code_position(tb.tb_frame.f_code, tb.tb_lasti)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/traceback.py", line 364, in _get_code_position
    if instruction_index < 0:
       ^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded in comparison

Original exception was:
Traceback (most recent call last):
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/_qt/widgets/qt_viewer_dock_widget.py", line 278, in _on_visibility_changed
    self.title = QtCustomTitleBar(
                 ^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/_qt/widgets/qt_viewer_dock_widget.py", line 314, in __init__
    self.setToolTip(trans._('drag to move. double-click to float'))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/utils/translations.py", line 447, in _
    else self._dnpgettext(msgid=msgid, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/utils/translations.py", line 398, in _dnpgettext
    translation = gettext.dgettext(self._domain, msgid)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/gettext.py", line 568, in dgettext
    t = translation(domain, _localedirs.get(domain, None))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/gettext.py", line 511, in translation
    mofiles = find(domain, localedir, languages, all=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/gettext.py", line 474, in find
    val = os.environ.get(envar)
          ^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/linecache.py", line 46, in getlines
    return updatecache(filename, module_globals)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/linecache.py", line 86, in updatecache
    if len(cache[filename]) != 1:
       ^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded while calling a Python object

Original exception was:
Traceback (most recent call last):
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/_qt/widgets/qt_viewer_dock_widget.py", line 278, in _on_visibility_changed
    self.title = QtCustomTitleBar(
                 ^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/_qt/widgets/qt_viewer_dock_widget.py", line 314, in __init__
    self.setToolTip(trans._('drag to move. double-click to float'))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/utils/translations.py", line 447, in _
    else self._dnpgettext(msgid=msgid, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/site-packages/napari/utils/translations.py", line 398, in _dnpgettext
    translation = gettext.dgettext(self._domain, msgid)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/gettext.py", line 568, in dgettext
    t = translation(domain, _localedirs.get(domain, None))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/gettext.py", line 511, in translation
    mofiles = find(domain, localedir, languages, all=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ian/mambaforge/envs/micro-control/lib/python3.11/gettext.py", line 474, in find
    val = os.environ.get(envar)
          ^^^^^^^^^^^^^^^^^^^^^
  File "<frozen _collections_abc>", line 774, in get
  File "<frozen os>", line 675, in __getitem__
RecursionError: maximum recursion depth exceeded

napari: 0.4.17
Platform: Linux-5.17.15-76051715-generic-x86_64-with-glibc2.35
System: Pop!_OS 22.04 LTS
Python: 3.11.0 | packaged by conda-forge | (main, Oct 25 2022, 06:24:40) [GCC 10.4.0]
Qt: 5.15.6
PyQt5: 5.15.7
NumPy: 1.24.1
SciPy: 1.10.0
Dask: 2022.12.1
VisPy: 0.11.0
magicgui: 0.6.1
superqt: unknown
in-n-out: 0.1.6
app-model: 0.1.1
npe2: 0.6.1

OpenGL:
- GL version: 4.6 (Compatibility Profile) Mesa 22.0.1
- MAX_TEXTURE_SIZE: 16384

Screens:
- screen 1: resolution 1920x1080, scale 1.0

It seems that something is going very poorly when displaying this warning which may be a napari problem? Any pointers @tlambert03?

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

Successfully merging a pull request may close this issue.

1 participant