Fix encoding while saving notebook preview (#443)

This commit is contained in:
Irfaan Arif 2021-09-02 18:56:56 +05:30 committed by GitHub
parent 7dc88cfb15
commit 63ccdd51f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -409,7 +409,7 @@ class _JupyterObserver(object):
from nbconvert.exporters import HTMLExporter # noqa
html, _ = HTMLExporter().from_filename(filename=local_jupyter_filename)
local_html = Path(gettempdir()) / 'notebook_{}.html'.format(task.id)
with open(local_html.as_posix(), 'wt') as f:
with open(local_html.as_posix(), 'wt', encoding="utf-8") as f:
f.write(html)
task.upload_artifact(
name='notebook preview', artifact_object=local_html,