convert str to byte for write tempfile

This commit is contained in:
Milka64 2023-12-10 22:11:18 +01:00
parent 9673ccfd83
commit bd97135588

View file

@ -17,7 +17,7 @@ class D2langDirective(Directive):
diag_source = self.content
with tempfile.NamedTemporaryFile() as fp:
for line in self.content:
fp.write(line)
fp.write(bytes(line,'utf-8'))
cmd_line = '%s %s %s' % (d2_bin, fp.name, srcdir + "/test.svg")
args = shlex.split(cmd_line)
subprocess.run(args)