From f63385ac4bd0ca9a8ab07ea1cb3fa75c378f1311 Mon Sep 17 00:00:00 2001 From: Josip Date: Sun, 15 Mar 2015 01:04:15 +0100 Subject: [PATCH] 8023: HTML view fails to load support both py2 and py3 with non-ascii chars --- gramps/plugins/view/htmlrenderer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gramps/plugins/view/htmlrenderer.py b/gramps/plugins/view/htmlrenderer.py index a2b754f62..0089e0600 100644 --- a/gramps/plugins/view/htmlrenderer.py +++ b/gramps/plugins/view/htmlrenderer.py @@ -30,7 +30,7 @@ Can use the Webkit or Gecko ( Mozilla ) library # Python modules # #------------------------------------------------------------------------- -import os +import os, io import sys if sys.version_info[0] < 3: from urlparse import urlunsplit @@ -557,7 +557,7 @@ class HtmlView(NavigationView): # Now we have two views : Web and Geography, we need to create the # startpage only once. if not os.path.exists(filename): - ufd = open(filename, "w+") + ufd = io.open(filename, "w+", encoding="utf8") ufd.write(data) ufd.close() return urlunsplit(('file', '',