From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 14 Jul 2025 02:49:36 +0000 (+0200) Subject: [3.14] gh-127146: Emscripten: Fix test_open_undecodable_uri by setting `-sTEXTDECODER... X-Git-Tag: v3.14.0rc1~78 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=261818061eb38ac42f9bc35335361c8c55f47b3b;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-127146: Emscripten: Fix test_open_undecodable_uri by setting `-sTEXTDECODER=2` (GH-136624) (#136631) 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. (cherry picked from commit 283b05052338dd735cd4927011afc3735d9c6c7c) Co-authored-by: Hood Chatham --- diff --git a/configure b/configure index a62f1ae7cac5..67a40b841aa5 100755 --- 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 : diff --git a/configure.ac b/configure.ac index d644c0ca772c..bbd0fa8c1ae8 100644 --- a/configure.ac +++ b/configure.ac @@ -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"])