]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-127146: Emscripten: Fix test_open_undecodable_uri by setting `-sTEXTDECODER=2...
authorHood Chatham <roberthoodchatham@gmail.com>
Sun, 13 Jul 2025 18:30:38 +0000 (20:30 +0200)
committerGitHub <noreply@github.com>
Sun, 13 Jul 2025 18:30:38 +0000 (20:30 +0200)
Removes the JS text decoder fallback and gets rid of the bugs due to the differences
in behavior on invalid utf8 strings. See https://github.com/emscripten-core/emscripten/issues/24690.

configure
configure.ac

index 4292f33ce21dcea0091004e3a2136c8310b25e93..71d831e4d8a6bb91ef1b153b94c7e8745247225f 100755 (executable)
--- a/configure
+++ b/configure
@@ -9606,6 +9606,7 @@ fi
     as_fn_append LINKFORSHARED " -sEXPORTED_RUNTIME_METHODS=FS,callMain,ENV"
     as_fn_append LINKFORSHARED " -sEXPORTED_FUNCTIONS=_main,_Py_Version,__PyRuntime,__PyEM_EMSCRIPTEN_COUNT_ARGS_OFFSET,_PyGILState_GetThisThreadState,__Py_DumpTraceback"
     as_fn_append LINKFORSHARED " -sSTACK_SIZE=5MB"
+        as_fn_append LINKFORSHARED " -sTEXTDECODER=2"
 
     if test "x$enable_wasm_dynamic_linking" = xyes
 then :
index cc7a6e9397dded1032ab3bb3a771643c92b65c1b..91c26f34a524c1019dc033e32401b06c1f0bf7de 100644 (file)
@@ -2338,6 +2338,8 @@ AS_CASE([$ac_sys_system],
     AS_VAR_APPEND([LINKFORSHARED], [" -sEXPORTED_RUNTIME_METHODS=FS,callMain,ENV"])
     AS_VAR_APPEND([LINKFORSHARED], [" -sEXPORTED_FUNCTIONS=_main,_Py_Version,__PyRuntime,__PyEM_EMSCRIPTEN_COUNT_ARGS_OFFSET,_PyGILState_GetThisThreadState,__Py_DumpTraceback"])
     AS_VAR_APPEND([LINKFORSHARED], [" -sSTACK_SIZE=5MB"])
+    dnl Avoid bugs in JS fallback string decoding path
+    AS_VAR_APPEND([LINKFORSHARED], [" -sTEXTDECODER=2"])
 
     AS_VAR_IF([enable_wasm_dynamic_linking], [yes], [
       AS_VAR_APPEND([LINKFORSHARED], [" -sMAIN_MODULE"])