From 706e92be777f72cbe47dcaecf593734eaabcd023 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Mon, 15 Apr 2013 22:01:08 +0000 Subject: [PATCH] 6462: GEDCOM import fails (patch by Enno Borgsteede) svn: r22001 --- gramps/plugins/lib/libgedcom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 81bd9f91f..612b0722d 100644 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -1237,7 +1237,7 @@ class UTF8Reader(BaseReader): def reset(self): self.ifile.seek(0) data = self.ifile.read(3) - if data != "\xef\xbb\xbf": + if data != b"\xef\xbb\xbf": self.ifile.seek(0) def readline(self): @@ -7490,17 +7490,17 @@ class GedcomStageOne(object): package. """ line = input_file.read(2) - if line == "\xef\xbb": + if line == b"\xef\xbb": input_file.read(1) self.enc = "UTF8" return input_file - elif line == "\xff\xfe": + elif line == b"\xff\xfe": self.enc = "UTF16" input_file.seek(0) return codecs.EncodedFile(input_file, 'utf8', 'utf16') elif not line : raise GedcomError(self.__EMPTY_GED) - elif line[0] == "\x00" or line[1] == "\x00": + elif line[0] == b"\x00" or line[1] == b"\x00": raise GedcomError(self.__BAD_UTF16) else: input_file.seek(0)