I have a GEDCOM file that I'm trying to import into Gramps. Below are 2 lines in the GEDCOM file:

1 _UID B19A60EAE1514673B05BA89353C6FF9B7909


The first is imported correctly as an attribute of the person, but the second is imported as an event. Is there some way to specify the second as an attribute, or maybe move the event to an attribute after the fact?

I am willing to modify Gramps Python code too, if someone can point me in the right direction.

  • Are you using the latest version of Gramps (4.0.1)? There's an open bug report for this in version 3.4: bugs.gramps-project.org/view.php?id=6391 . Maybe it was fixed later (although the bug was never closed, so maybe it got ignored).
    – Rob Hoare
    Oct 21, 2013 at 23:17
  • @RobHoare I'm not, they don't have a windows installer for it yet. Someone from the mailing list helped me hack the 3.4 version to make it work though.
    – dwwork
    Oct 22, 2013 at 15:14
  • You could describe the hack below as an answer (you're allowed to answer your own question), to help others who may have come across the same bug.
    – Rob Hoare
    Oct 22, 2013 at 19:10
  • 1
    Rob, that's my report, and I don't think it was fixed. I would know if it was. My hack is exactly like the answer below. Oct 22, 2013 at 21:30

2 Answers 2


As asked for above, here's what worked for me using gramps 3.4

The problem is in the GEDCOM interpreter, (libgedcom.py), which is located in the $(GRAMPS)/plugins/lib directory.

Gramps does not have a specification for the _FSFTID flag in this file.

What I did, (which as far as I can tell doesn't break anything), is as follows:

  1. Added a TOKEN__FSFTID constant at the end of the TOKEN_* list (in my case, setting it to 131)

  2. Added the string "_FSFTID" : TOKEN__FSFTID to the TOKENS dictionary.

  3. Added TOKEN__FSFTID : GedLine.calc_attr to the _MAP_DATA dictionary.

It might be necessary to remove the old libgedcom.pyc file. I did, and it worked just fine.

I think python will grab the .pyc file instead of the newly modified .py file if the .pyc file exists. I'm not entirely sure though. I'm still fairly new to python.

  • 1
    Right, this part is exactly like the hack I made when I filed the report mentioned above. Oct 22, 2013 at 21:30
  • 1
    You may also need one for export, but since it's difficult to put a patch in a comment, I put that in a separate answer. Oct 22, 2013 at 21:35

Try this for the export part:

Index: src/plugins/export/ExportGedcom.py
--- src/plugins/export/ExportGedcom.py  (revision 23370)
+++ src/plugins/export/ExportGedcom.py  (working copy)
@@ -634,7 +632,7 @@
             key = str(attr.get_type())
             value = attr.get_value().strip().replace('\r', ' ')

-            if key in ("AFN", "RFN", "REFN", "_UID"):
+            if key in ("AFN", "RFN", "REFN", "_UID", "_FSFTID"):
                 self.__writeln(1, key, value)

Line numbers may be off, because I have another uncommitted patch.

  • Thanks. I haven't tried exporting anything yet, so I hadn't looked into it. I'll make sure to fix that part too.
    – dwwork
    Oct 22, 2013 at 22:07
  • OK, there's more to do on events, so this is only part of my patch. Hope you're on the Gramps mail list too, so these things can be pushed there too. Oct 24, 2013 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.