Skip to content

Commit 301b842

Browse files
authored
Set PYTHONUTF8 when running tests on windows. NFC. (#14179)
Many of our tests include UTF8 encoded files, and on the CI machines python cannot read them since it uses the windows codepage which is `cp1252`. This envrionment variable forces python to assume UTF8 encoded text files and stdin/stdout. We already set this when running our windows tests on emscripten-releases bots. Add an extra test to the windows bot that verifies is can read UTF8 encoded expectations files (even though this test is about UTF16 the expectation file is still UTF8).
1 parent aa486b5 commit 301b842

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.circleci/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,9 @@ jobs:
452452
shell: bash.exe -eo pipefail
453453
environment:
454454
PYTHONUNBUFFERED: "1"
455+
# Override the default locale to use UTF-8 encoding for all files and stdio
456+
# streams (see PEP540), since oure test files are encoded with UTF-8.
457+
PYTHONUTF8: "1"
455458
EMSDK_NOTTY: "1"
456459
# clang can compile but not link in the current setup, see
457460
# https://github.com/emscripten-core/emscripten/pull/11382#pullrequestreview-428902638
@@ -470,7 +473,7 @@ jobs:
470473
# note we do *not* build all libraries and freeze the cache; as we run
471474
# only limited tests here, it's more efficient to build on demand
472475
- run-tests:
473-
test_targets: "other.test_emcc_cflags other.test_stdin other.test_bad_triple wasm2.test_sse1 wasm2.test_ccall other.test_closure_externs other.test_binaryen_debug other.test_js_optimizer_parse_error other.test_output_to_nowhere other.test_emcc_dev_null other.test_cmake* other.test_system_include_paths other.test_emar_response_file"
476+
test_targets: "other.test_emcc_cflags other.test_stdin other.test_bad_triple wasm2.test_sse1 wasm2.test_ccall other.test_closure_externs other.test_binaryen_debug other.test_js_optimizer_parse_error other.test_output_to_nowhere other.test_emcc_dev_null other.test_cmake* other.test_system_include_paths other.test_emar_response_file wasm2.test_utf16"
474477
test-mac:
475478
executor: mac
476479
steps:

0 commit comments

Comments
 (0)