diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index 34b4c96ab..0ac6d29ee 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -150,11 +150,15 @@ class GeoGraphyView(OsmGps, NavigationView): self.geo_mainmap = None path = os.path.join(ROOT_DIR, "images", "48x48", ('gramps-geo-mainmap' + '.png' )) - pathu = path.encode(sys.getfilesystemencoding()) + pathu = path + if sys.version_info[0] < 3: + pathu = path.encode(sys.getfilesystemencoding()) self.geo_mainmap = cairo.ImageSurface.create_from_png(pathu) path = os.path.join(ROOT_DIR, "images", "48x48", ('gramps-geo-altmap' + '.png' )) - pathu = path.encode(sys.getfilesystemencoding()) + pathu = path + if sys.version_info[0] < 3: + pathu = path.encode(sys.getfilesystemencoding()) self.geo_altmap = cairo.ImageSurface.create_from_png(pathu) if ( config.get('geography.map_service') in ( constants.OPENSTREETMAP, @@ -169,7 +173,9 @@ class GeoGraphyView(OsmGps, NavigationView): EventType.MARRIAGE ): path = os.path.join(ROOT_DIR, "images", "48x48", (constants.ICONS.get(int(ident), default_image) + '.png' )) - pathu = path.encode(sys.getfilesystemencoding()) + pathu = path + if sys.version_info[0] < 3: + pathu = path.encode(sys.getfilesystemencoding()) self.geo_othermap[ident] = cairo.ImageSurface.create_from_png(pathu) def change_page(self): diff --git a/gramps/plugins/view/pedigreeview.py b/gramps/plugins/view/pedigreeview.py index 1b94e2773..32475083c 100644 --- a/gramps/plugins/view/pedigreeview.py +++ b/gramps/plugins/view/pedigreeview.py @@ -208,7 +208,7 @@ class PersonBoxWidgetCairo(_PersonWidgetBase): self.img_surf = None if image: image_path = self.get_image(dbstate, person) - if isinstance(image_path, STRTYPE): + if sys.version_info[0] < 3 and isinstance(image_path, STRTYPE): image_path = image_path.encode(sys.getfilesystemencoding()) if image_path and os.path.exists(image_path): self.img_surf = cairo.ImageSurface.create_from_png(image_path)