Unhandled exception Traceback (most recent call last)

An exception on ubuntu 22.04. I did nothing, the app was in background, clipboard was opened only.

42192310: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/gramps/gui/widgets/styledtexteditor.py", line 698, in __set_fallback_icons
    icon = tool_button.get_child().get_child()
AttributeError: 'NoneType' object has no attribute 'get_child'

GRAMPS: 5.2.1
Python: 3.10.12
BSDDB: 6.2.9 (5, 3, 28)
sqlite: 3.37.2 (2.6.0)
LANG: en_US.UTF-8
OS: Linux
Distribution: 6.5.0-26-generic

In my job, we’d call this highly suspicious code, with that nested call to get_child().

It’s new in 5.2.1, and the availability of icons can depend on themes.

Ive reported here 0013250: Unhandled exception Traceback (most recent call last) - Gramps - Bugtracker – Free Genealogy Software

1 Like

Is there anything more that you can tell about the circumstances? Was there anything on the clipboard?

Sure. There were two my new Sources. I didn’t minimize the app, just switched to browser. And later I faced the exception.

The child of a Gtk.ToolButton is a Gtk.Button, and the child of a Gtk.Button is either a Gtk.Image or None if the button doesn’t have an associated icon.

In this case the code provides a fallback for the standard superscript and subscript icons which are sometimes unavailable.

The code is used in the note editor, but the same code may also be used in read-only mode to display text in the note gramplets and possibly elsewhere.

1 Like

The exception suggests that the 1st child can be None too.

The __set_fallback_icons function is called when the editor toolbar is created and when the icon theme is changed.

It’s probably that the actual button doesn’t exist. Perhaps an old version of the toolbar exists without the subscript and superscript buttons?

There are icons for the new Note Editor features in 2 MantisBT issues. The 1st is a comprehensive theme stencil of icons for Gramps. The 2nd is specific to the 2 new Note styling features

https://gramps-project.org/bugs/view.php?id=12497

https://gramps-project.org/bugs/view.php?id=12704

so, has anybody solution haw to fix this? It happens each time when I dont use the app during some period of time, maybe 1-2 hrs. And I have Clipboard opened also (dont know if it has some affect). Does it repro for me only?

There is a possible fix attached to your bug report, but that hasn’t made it to a release yet.

Are you able to try that fix on the source code?

sure, I can use this fix on my side

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.