If Python startup code calls `exit` (for instance because `--version` or `--help`
was passed), then Emscripten calls `quit` which throws the error. The enclosing
environment catches that error and burns the evidence. This modifies `quit` to
record the fact that `exit` was called and rethrow the error (which will include the
exit code). Otherwise, trying to run the command line runner with `python --version`
will segfault.
This fixes#3011.
We attempted to make a test for this, but in all of our tests
`document.location === indexURL`. Our logic incorrectly used indexURL
instead of `document.location`.
As discussed in #2940, this PR changes the default value of the fullStdLib flag in loadPyodide to false.
This is a breaking change because for now distutils is not loaded by default.
Also, when fullStdLib is set to true, it loads all unvendored stdlibs except for test.
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Unvendor the standard library sqlite3 to reduce the size of the main module. It reduces the size of pyodide.asm.wasm around ~1.4MB.
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
The out of tree build system applies an abi tag based on `PYODIDE_EMSCRIPTEN_VERSION`
in `Makefile.envs`. Prior to this PR, it will happily accept the version of emscripten (say 3.1.18)
and produce a wheel tagged like it was produced from the expected Emscripten version (say 3.1.14).
This causes confusing errors due to ABI mismatch see igraph/python-igraph#560. This error message
should help prevent such confusion.
This PR reverts the indentation change introduced in #2909, to make sure badges
are displayed correctly. I've checked at pyodide.org/en/latest/project/changelog.html
and badges are, in fact, temporarily broken.
This fixes a few problems introduced in #2907 (and some older issues). The slicing doesn't work correctly for `TypedArray` or `NodeList` and there are several possible routes to take with `TypedArray` so I think it's better to leave it not implemented for now. Also, `extend` and `+=` don't work for `TypedArray` and `NodeList`. This also gives a better error if you attempt `del a[0]` when `a` is a `TypedArray` or `NodeList`. The former have a fixed length, the latter are immutable.