Skip to content

Commit e43da95

Browse files
committed
cargo: Add explicit encoding argument to open()
1 parent 2bd7e80 commit e43da95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cargo/flatpak-cargo-generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def get_remote_sha256(url: str) -> str:
110110

111111

112112
def load_toml(tomlfile: str = "Cargo.lock") -> _TomlType:
113-
with open(tomlfile, "r") as f:
113+
with open(tomlfile, "r", encoding="utf-8") as f:
114114
toml_data = toml.load(f)
115115
return toml_data
116116

@@ -481,10 +481,10 @@ def main():
481481
)
482482

483483
if args.yaml and YAML_AVAIL:
484-
with open(outfile, "w") as out:
484+
with open(outfile, "w", encoding="utf-8") as out:
485485
yaml.dump(generated_sources, out, sort_keys=False)
486486
else:
487-
with open(outfile, "w") as out:
487+
with open(outfile, "w", encoding="utf-8") as out:
488488
json.dump(generated_sources, out, indent=4, sort_keys=False)
489489

490490

0 commit comments

Comments
 (0)