From c872d2302a6fa9ccb397ffb082963de78cfb9177 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 30 May 2025 15:20:53 -0400 Subject: [PATCH] Simplify GEDCOM parsing to read file directly --- kjvstudy_org/server.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kjvstudy_org/server.py b/kjvstudy_org/server.py index 9984b54..5103a26 100644 --- a/kjvstudy_org/server.py +++ b/kjvstudy_org/server.py @@ -1060,14 +1060,9 @@ def parse_gedcom_to_tree_data(gedcom_path): """Parse GEDCOM file into our family tree format""" tree_data = {} - # Read GEDCOM file content first + # Parse with ged4py directly from file path with open(gedcom_path, 'r', encoding='utf-8') as f: - gedcom_content = f.read() - - # Parse with ged4py using string content - from io import StringIO - gedcom_io = StringIO(gedcom_content) - gedcom = GedcomReader(gedcom_io) + gedcom = GedcomReader(f) # First pass: collect all individuals for record in gedcom.records0: