Merge pull request #5003 from achillesrasquinha/fixes-py3
encode utf-8 for help database
This commit is contained in:
commit
283290e734
1 changed files with 4 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue