From 5bfd79c6a3eac3486541722837084eb5e8ea75e4 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 17 May 2006 01:23:14 +0000 Subject: [PATCH] 2006-05-16 Don Allingham * src/GrampsDb/_ReadGedcom.py: handle blank lines svn: r6684 --- ChangeLog | 3 +++ src/GrampsDb/_ReadGedcom.py | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 181371fc7..1ab4d506d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-05-16 Don Allingham + * src/GrampsDb/_ReadGedcom.py: handle blank lines + 2006-05-16 Alex Roitman * src/Selectors/_SelectPerson.py: Use new package. * src/plugins/RelCalc.py: Use new package. diff --git a/src/GrampsDb/_ReadGedcom.py b/src/GrampsDb/_ReadGedcom.py index 9adce0d7d..8654271c3 100644 --- a/src/GrampsDb/_ReadGedcom.py +++ b/src/GrampsDb/_ReadGedcom.py @@ -449,9 +449,11 @@ class Reader: def readahead(self): while len(self.current_list) < 5: - line = self.f.readline() + old_line = self.f.readline() self.index += 1 - line = line.strip('\r\n') + line = old_line.strip('\r\n') + if line == "" and line != old_line: + continue if line == "": self.f.close() self.eof = True @@ -1091,7 +1093,7 @@ class GedcomParser(UpdateCallback): mrel = _TYPE_BIRTH frel = _TYPE_BIRTH # Legacy _PREF - elif matches[1][0] == TOKEN_UNKNOWN: + elif matches[1] and matches[1][0] == TOKEN_UNKNOWN: pass else: self.barf(level+1)