From 9af4f9f71903602768071c14154b15aebc5061ea Mon Sep 17 00:00:00 2001 From: boc5244 <31375763+boc5244@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:46:36 -0800 Subject: [PATCH] Fix write_svg method, open the file in binary mode --- figurefirst/svg_to_axes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/figurefirst/svg_to_axes.py b/figurefirst/svg_to_axes.py index 01fd2ed..44ec34d 100644 --- a/figurefirst/svg_to_axes.py +++ b/figurefirst/svg_to_axes.py @@ -1444,7 +1444,7 @@ def write_svg(self, output_filename): self.output_xml.writexml(outfile, encoding="utf-8") except UnicodeEncodeError: outfile.close() - outfile = open(output_filename, "w") + outfile = open(output_filename, "wb") outfile.write(self.output_xml.toxml().encode("ascii", "xmlcharrefreplace")) outfile.close()