ValueError: unsupported format character '_' (0x5f) at index 5`

I’ve created a people filter by tag. Then I switched to the Events list and created another event-filter matching the person filter, and chosen filter from the previous step. Then I tried to apply this event filter via the “Filter” gramplet

37770477: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/filters/sidebar/_sidebarfilter.py", line 166, in clicked
    self.clicked_func()
  File "/usr/lib/python3/dist-packages/gramps/plugins/gramplet/filter.py", line 78, in __filter_clicked
    self.gui.view.build_tree()
  File "/usr/lib/python3/dist-packages/gramps/gui/views/listview.py", line 359, in build_tree
    self.model.rebuild_data()
  File "/usr/lib/python3/dist-packages/gramps/gui/views/treemodels/flatbasemodel.py", line 630, in _rebuild_filter
    dlist = self.search.apply(cdb, allkeys, tupleind=1, user=self.user)
  File "/usr/lib/python3/dist-packages/gramps/gen/filters/_genericfilter.py", line 295, in apply
    res = self.apply_logical_op_to_all(
  File "/usr/lib/python3/dist-packages/gramps/gen/filters/_genericfilter.py", line 213, in apply_logical_op_to_all
    if apply_logical_op(db, obj, self.flist) != self.invert:
  File "/usr/lib/python3/dist-packages/gramps/gen/filters/_genericfilter.py", line 222, in and_test
    return all(rule.apply_to_one(db, data) for rule in flist)
  File "/usr/lib/python3/dist-packages/gramps/gen/filters/_genericfilter.py", line 222, in <genexpr>
    return all(rule.apply_to_one(db, data) for rule in flist)
  File "/usr/lib/python3/dist-packages/gramps/gen/filters/rules/_matchesfilterbase.py", line 103, in apply_to_one
    return filt.apply_to_one(db, obj)
  File "/usr/lib/python3/dist-packages/gramps/gen/filters/_genericfilter.py", line 244, in apply_to_one
    res = self.and_test(db, data, self.flist)
  File "/usr/lib/python3/dist-packages/gramps/gen/filters/_genericfilter.py", line 222, in and_test
    return all(rule.apply_to_one(db, data) for rule in flist)
  File "/usr/lib/python3/dist-packages/gramps/gen/filters/_genericfilter.py", line 222, in <genexpr>
    return all(rule.apply_to_one(db, data) for rule in flist)
  File "/usr/lib/python3/dist-packages/gramps/gen/filters/rules/event/_matchespersonfilter.py", line 86, in apply_to_one
    person = db.method("get_%_from_handle", classname)(handle)
  File "/usr/lib/python3/dist-packages/gramps/gen/db/base.py", line 1465, in method
    return getattr(self, fmt % tuple([arg.lower() for arg in args]), None)
ValueError: unsupported format character '_' (0x5f) at index 5

Gramps 6.0.0
ubuntu 22.04

What is the filter name?

It looks like the Name should not have validated when the filter was created. Maybe the name has a leading or trailing underscore?

Person filters:

Event filters:

1 Like

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