doc: Fix encoding problem

Depending on the version of Python 3 the user has installed, 'open'
may default to using 'ascii' encoding.  Since the documentation is in
UTF-8, and contains characters beyond 'ascii', this will result in
failures when using these versions of Python.

Fix this by being explicit about the encoding to be used when reading
these files.

Signed-off-by: David Brown <david.brown@linaro.org>
Change-Id: I54c69334c6bf377f1135cec04f4e0ea96a8e9a5b
This commit is contained in:
David Brown 2017-02-03 14:23:46 -07:00 committed by Anas Nashif
commit 53266a3836

View file

@ -38,7 +38,7 @@ def get_rst_files(dir):
shutil.copyfile(file, os.path.join(ZEPHYR_BASE, "doc", frel))
with open(file) as f:
with open(file, encoding="utf-8") as f:
content = f.readlines()
content = [x.strip() for x in content]
directives = "|".join(DIRECTIVES)