diff --git a/frappe/utils/help.py b/frappe/utils/help.py index 45971820c0..df6bfb884a 100644 --- a/frappe/utils/help.py +++ b/frappe/utils/help.py @@ -15,6 +15,8 @@ from bs4 import BeautifulSoup import jinja2.exceptions from six import text_type +import io + def sync(): # make table print('Syncing help database...') @@ -135,9 +137,9 @@ class HelpDatabase(object): for fname in files: if fname.rsplit('.', 1)[-1] in ('md', 'html'): fpath = os.path.join(basepath, fname) - with open(fpath, 'r') as f: + with io.open(fpath, 'r', encoding = 'utf-8') as f: try: - content = frappe.render_template(text_type(f.read(), 'utf-8'), + content = frappe.render_template(f.read(), {'docs_base_url': '/assets/{app}_docs'.format(app=app)}) relpath = self.get_out_path(fpath)