# Surnames list handling

**URL:** <https://gramps.discourse.group/t/surnames-list-handling/7735>\
**Category:** Development\
**Created:** [May 25, 2025, 9:49am UTC](https://gramps.discourse.group/t/surnames-list-handling/7735 "2025-05-25T09:49:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![romjerome](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/romjerome/32/1489_2.png) [@romjerome](https://gramps.discourse.group/u/romjerome)\
**Post date:** [May 25, 2025, 9:49am UTC](https://gramps.discourse.group/t/surnames-list-handling/7735/1 "2025-05-25T09:49:38Z")

</div>

Suite du sujet [When Gramps will build the surnames list on the first time?](https://gramps.discourse.group/t/when-gramps-will-build-the-surnames-list-on-the-first-time/7202) :

> [@When Gramps will build the surnames list on the first time?](https://gramps.discourse.group/t/when-gramps-will-build-the-surnames-list-on-the-first-time/7202/1):
>
> What will happen if we look at surnames (tools, gramplets, surname guessing) on the first run after a Gramps XML importation into a new Family Tree ?

The reported (possible) issue should not specfic to DB upgrade (from bsddb or whatever format). But looking at one pull request (bug fix)

> <https://github.com/gramps-project/gramps/pull/2064>
>
> User was unable to add new person immediately after performing upgrade from olde…r version.
> \`\`\`
> File "C:\\Program Files\\GrampsAIO64-6.0.1\\gramps\\gen\\db\\generic.py", line 2605, in add\_to\_surname\_list
> i = bisect.bisect(self.surname\_list, name)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> TypeError: '\<' not supported between instances of 'str' and 'NoneType'
> \`\`\`
> Turns out that upgrade from bsddb did not initialize the surname list; the upgrade code was saving json data with raw\_commit, so the usual commit\_person code which would have update the surname list was not executed.
> 
> Fixes \[#13807\](https://gramps-project.org/bugs/view.php?id=13807).

I just wonder if, by default, Gramps sets an empty surnames list or any metadata info during DB creation? Even empty, this might be updated at the first DB commit (import or edition).

---

<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:** [June 24, 2025, 9:50am UTC](https://gramps.discourse.group/t/surnames-list-handling/7735/2 "2025-06-24T09:50:28Z")

</div>

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