Fix #1974 - Use utf-8 encoding to bootstrap stdlib (#1981)

This commit is contained in:
Andrea Giammarchi
2024-02-14 09:59:18 +01:00
committed by GitHub
parent f6d5cf06c8
commit 5bed5ede52
9 changed files with 67 additions and 67 deletions

View File

@@ -21,7 +21,7 @@ const write = (base, literal) => {
python.push(`_path = _Path("${base}/${key}")`);
if (typeof value === "string") {
const code = JSON.stringify(value);
python.push(`_path.write_text(${code})`);
python.push(`_path.write_text(${code},encoding="utf-8")`);
} else {
// @see https://github.com/pyscript/pyscript/pull/1813#issuecomment-1781502909
python.push(`if not _os.path.exists("${base}/${key}"):`);