Skip to content

Commit 8c5ac8b

Browse files
committed
utf-8
1 parent de09039 commit 8c5ac8b

File tree

8 files changed

+9
-11
lines changed

8 files changed

+9
-11
lines changed

src/semiwrap/casters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ class TypeCasterJsonData:
3030

3131

3232
def load_typecaster_json_data(fname) -> TypeCasterJsonData:
33-
with open(fname) as fp:
33+
with open(fname, encoding="utf-8") as fp:
3434
return parse_input(json.load(fp), TypeCasterJsonData, fname)
3535

3636

3737
def save_typecaster_json_data(fname: pathlib.Path, data: TypeCasterJsonData):
38-
with open(fname, "w") as fp:
38+
with open(fname, "w", encoding="utf-8") as fp:
3939
json.dump(dataclasses.asdict(data), fp)
4040

4141

src/semiwrap/cmd/dat2cpp.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ def _write_wrapper_cpp(input_dat: pathlib.Path, output_cpp: pathlib.Path):
1818
assert isinstance(hctx, HeaderContext)
1919

2020
content = render_wrapped_cpp(hctx)
21-
with open(output_cpp, "w", encoding="utf-8") as fp:
22-
fp.write(content)
21+
output_cpp.write_text(content, encoding="utf-8")
2322

2423

2524
def main():

src/semiwrap/cmd/dat2tmplcpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _write_wrapper_cpp(input_dat: pathlib.Path, py_name: str, output_cpp: pathli
2424
raise ValueError(f"internal error: cannot find {py_name} in {hctx.orig_yaml}")
2525

2626
content = render_template_inst_cpp(hctx, tmpl)
27-
output_cpp.write_text(content)
27+
output_cpp.write_text(content, encoding="utf-8")
2828

2929

3030
def main():

src/semiwrap/cmd/dat2tmplhpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _write_tmpl_hpp(input_dat: pathlib.Path, output_hpp: pathlib.Path):
1616
assert isinstance(hctx, HeaderContext)
1717

1818
content = render_template_inst_hpp(hctx)
19-
output_hpp.write_text(content)
19+
output_hpp.write_text(content, encoding="utf-8")
2020

2121

2222
def main():

src/semiwrap/cmd/dat2trampoline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _write_wrapper_cpp(input_dat: pathlib.Path, yml_id: str, output_hpp: pathlib
4848
raise ValueError("\n".join(msg))
4949

5050
content = render_cls_trampoline_hpp(hctx, cls)
51-
output_hpp.write_text(content)
51+
output_hpp.write_text(content, encoding="utf-8")
5252

5353

5454
def main():

src/semiwrap/cmd/gen_libinit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def _write_libinit_py(
3232
for mod in modules:
3333
r.writeln(f"import {mod}")
3434

35-
init_py.write_text(r.getvalue())
35+
init_py.write_text(r.getvalue(), encoding="utf-8")
3636

3737

3838
def main():

src/semiwrap/cmd/gen_modinit_hpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _write_wrapper_hpp(
9393

9494
r.writeln("}")
9595

96-
output_hpp.write_text(r.getvalue())
96+
output_hpp.write_text(r.getvalue(), encoding="utf-8")
9797

9898

9999
def main():

src/semiwrap/mkpc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,4 @@ def make_pc_file(
4848

4949
pc_content.append("")
5050

51-
with open(pcfile, "w") as fp:
52-
fp.write("\n".join(pc_content))
51+
pcfile.write_text("\n".join(pc_content), encoding="utf-8")

0 commit comments

Comments
 (0)