File tree 2 files changed +3
-2
lines changed
packages/python/plotly/plotly
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -533,7 +533,8 @@ def write_html(
533
533
534
534
# Write HTML string
535
535
if path is not None :
536
- path .write_text (html_str )
536
+ # To use a different file encoding, pass a file descriptor
537
+ path .write_text (html_str , "utf-8" )
537
538
else :
538
539
file .write (html_str )
539
540
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def test_write_html():
40
40
mock_pathlib_path = Mock (spec = Path )
41
41
pio .write_html (fig , mock_pathlib_path )
42
42
mock_pathlib_path .write_text .assert_called_once ()
43
- ( pl_html ,) = mock_pathlib_path .write_text .call_args [0 ]
43
+ pl_html = mock_pathlib_path .write_text .call_args [ 0 ] [0 ]
44
44
assert replace_div_id (html ) == replace_div_id (pl_html )
45
45
46
46
# Test pio.write_html with a mock file descriptor
You can’t perform that action at this time.
0 commit comments