Skip to content

Commit 4e3d2c2

Browse files
committed
WASM64 fixes
1 parent 96692da commit 4e3d2c2

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Lib/test/test_warnings/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,14 @@ def test_warn_explicit_non_ascii_filename(self):
487487
module=self.module) as w:
488488
self.module.resetwarnings()
489489
self.module.filterwarnings("always", category=UserWarning)
490-
for filename in ("nonascii\xe9\u20ac", "surrogate\udc80"):
490+
filenames = ["nonascii\xe9\u20ac"]
491+
if not support.is_emscripten:
492+
# JavaScript does not like surrogates
493+
# Invalid UTF-8 leading byte 0x80 encountered when
494+
# deserializing a UTF-8 string in wasm memory to a JS
495+
# string!
496+
filenames.append("surrogate\udc80")
497+
for filename in filenames:
491498
try:
492499
os.fsencode(filename)
493500
except UnicodeEncodeError:

Tools/wasm/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,15 @@ Node builds use ``NODERAWFS``.
212212
- Node RawFS allows direct access to the host file system without need to
213213
perform ``FS.mount()`` call.
214214

215+
## wasm64-emscripten
216+
217+
- wasm64 requires recent NodeJS and ``--experimental-wasm-memory64``.
218+
- ``EM_JS`` functions must return ``BigInt()``.
219+
- ``Py_BuildValue()`` format strings must match size of types. Confusing 32
220+
and 64 bits types leads to memory corruption, see
221+
[gh-95876](https://github.com/python/cpython/issues/95876) and
222+
[gh-95878](https://github.com/python/cpython/issues/95878).
223+
215224
# Hosting Python WASM builds
216225

217226
The simple REPL terminal uses SharedArrayBuffer. For security reasons

0 commit comments

Comments
 (0)