We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dfef73e + 1f86ff0 commit f3bfd21Copy full SHA for f3bfd21
packages/python/plotly/plotly/io/_html.py
@@ -533,7 +533,8 @@ def write_html(
533
534
# Write HTML string
535
if path is not None:
536
- path.write_text(html_str)
+ # To use a different file encoding, pass a file descriptor
537
+ path.write_text(html_str, "utf-8")
538
else:
539
file.write(html_str)
540
packages/python/plotly/plotly/tests/test_io/test_pathlib.py
@@ -40,7 +40,7 @@ def test_write_html():
40
mock_pathlib_path = Mock(spec=Path)
41
pio.write_html(fig, mock_pathlib_path)
42
mock_pathlib_path.write_text.assert_called_once()
43
- (pl_html,) = mock_pathlib_path.write_text.call_args[0]
+ pl_html = mock_pathlib_path.write_text.call_args[0][0]
44
assert replace_div_id(html) == replace_div_id(pl_html)
45
46
# Test pio.write_html with a mock file descriptor
0 commit comments