Skip to content

Commit 4778900

Browse files
committed
fix(stream_file): fix bug
1 parent 131f369 commit 4778900

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plot_data/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ def _to_html(self, debug_mode: bool = False, canvas_id: str = 'canvas', version:
112112
def to_html_stream(self, stream, debug_mode: bool = False, canvas_id: str = 'canvas', version: str = None):
113113
""" Export current Figure to its equivalent html stream file. """
114114
html = self._to_html(debug_mode=debug_mode, canvas_id=canvas_id, version=version)
115-
stream.write(html.encode('utf-8'))
115+
stream.write(html)
116116

117117
def to_html(self, filepath: str = None, debug_mode: bool = False, canvas_id: str = 'canvas', version: str = None):
118118
""" Export current Figure to an HTML file given by the filepath. """
119119
filepath = make_filepath(filepath=filepath)
120-
with open(filepath, 'wb') as file:
120+
with open(filepath, 'w') as file:
121121
self.to_html_stream(file, debug_mode=debug_mode, canvas_id=canvas_id, version=version)
122122
return filepath
123123

0 commit comments

Comments
 (0)