File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
packages/python/plotly/plotly Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -533,7 +533,8 @@ def write_html(
533533
534534 # Write HTML string
535535 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" )
537538 else :
538539 file .write (html_str )
539540
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def test_write_html():
4040 mock_pathlib_path = Mock (spec = Path )
4141 pio .write_html (fig , mock_pathlib_path )
4242 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 ]
4444 assert replace_div_id (html ) == replace_div_id (pl_html )
4545
4646 # Test pio.write_html with a mock file descriptor
You can’t perform that action at this time.
0 commit comments