https://github.com/python/cpython/commit/283b05052338dd735cd4927011afc3735d9c6c7c
commit: 283b05052338dd735cd4927011afc3735d9c6c7c
branch: main
author: Hood Chatham <[email protected]>
committer: freakboy3742 <[email protected]>
date: 2025-07-13T20:30:38+02:00
summary:

gh-127146: Emscripten: Fix test_open_undecodable_uri by setting 
`-sTEXTDECODER=2` (#136624)

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.

files:
M configure
M configure.ac

diff --git a/configure b/configure
index 4292f33ce21dce..71d831e4d8a6bb 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 cc7a6e9397dded..91c26f34a524c1 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"])

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to