python3 requires str (=unicode) to load from file
svn: r20667
This commit is contained in:
parent
945819631c
commit
4e8437bae4
@ -150,10 +150,14 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
self.geo_mainmap = None
|
||||
path = os.path.join(ROOT_DIR, "images", "48x48",
|
||||
('gramps-geo-mainmap' + '.png' ))
|
||||
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
|
||||
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
|
||||
@ -169,6 +173,8 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
EventType.MARRIAGE ):
|
||||
path = os.path.join(ROOT_DIR, "images", "48x48",
|
||||
(constants.ICONS.get(int(ident), default_image) + '.png' ))
|
||||
pathu = path
|
||||
if sys.version_info[0] < 3:
|
||||
pathu = path.encode(sys.getfilesystemencoding())
|
||||
self.geo_othermap[ident] = cairo.ImageSurface.create_from_png(pathu)
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user