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

**URL:** <https://gramps.discourse.group/t/valueerror-unsupported-format-character-0x5f-at-index-5/7486>\
**Category:** Help\
**Created:** [April 20, 2025, 4:31pm UTC](https://gramps.discourse.group/t/valueerror-unsupported-format-character-0x5f-at-index-5/7486 "2025-04-20T16:31:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Urchello](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@Urchello](https://gramps.discourse.group/u/Urchello)\
**Post date:** [April 20, 2025, 4:31pm UTC](https://gramps.discourse.group/t/valueerror-unsupported-format-character-0x5f-at-index-5/7486/1 "2025-04-20T16:31:34Z")

</div>

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

```python
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

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [April 20, 2025, 11:02pm UTC](https://gramps.discourse.group/t/valueerror-unsupported-format-character-0x5f-at-index-5/7486/2 "2025-04-20T23:02:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Urchello](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@Urchello](https://gramps.discourse.group/u/Urchello)\
**Post date:** [April 21, 2025, 5:29am UTC](https://gramps.discourse.group/t/valueerror-unsupported-format-character-0x5f-at-index-5/7486/3 "2025-04-21T05:29:41Z")

</div>

> [@emyoulation](#):
>
> 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:

 ![2025-04-21_08-27-58](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/5/53d029d14c656c4362004c6803c3760107e8363a.jpeg)

Event filters:

 ![2025-04-21_08-28-45](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/8/8a2c1e091ce02cdd02e34865e532414a938ee8f0.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [May 21, 2025, 5:30am UTC](https://gramps.discourse.group/t/valueerror-unsupported-format-character-0x5f-at-index-5/7486/4 "2025-05-21T05:30:22Z")

</div>

Closed on May 21, 2025, 5:30am UTC

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