Skip to content

gh-146416: Emscripten: Improve standard stream handling in node_entry.mjs - #146417

Merged
vstinner merged 8 commits into
python:mainfrom
hoodmane:streams
Mar 30, 2026
Merged

gh-146416: Emscripten: Improve standard stream handling in node_entry.mjs#146417
vstinner merged 8 commits into
python:mainfrom
hoodmane:streams

Conversation

@hoodmane

@hoodmanehoodmane commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

@vstinner

Copy link
Copy Markdown
Member

The test suite fails on Emscripten with nodeFsync is not defined: https://github.com/python/cpython/actions/runs/23545540285/job/68544804717?pr=146417


0:00:13 load avg: 0.10 [ 78/502] test.test_os.test_os
file:///home/runner/work/cpython/cpython/cross-build/wasm32-emscripten/build/python/streams.mjs:189
nodeFsync(this.nodeStream.fd);
^
ReferenceError: nodeFsync is not defined
at NodeWriter.fsync (file:///home/runner/work/cpython/cpython/cross-build/wasm32-emscripten/build/python/streams.mjs:189:5)
at Object.fsync (file:///home/runner/work/cpython/cpython/cross-build/wasm32-emscripten/build/python/streams.mjs:136:11)
at Object.close (file:///home/runner/work/cpython/cpython/cross-build/wasm32-emscripten/build/python/streams.mjs:131:23)
at Object.close (file:///home/runner/work/cpython/cpython/cross-build/wasm32-emscripten/build/python/python.mjs:1:71931)
at _fd_close (file:///home/runner/work/cpython/cpython/cross-build/wasm32-emscripten/build/python/python.mjs:1:271594)
at wasm://wasm/02b6ddae:wasm-function[12183]:0x69a8ab
at wasm://wasm/02b6ddae:wasm-function[8357]:0x498ddf
at wasm://wasm/02b6ddae:wasm-function[1978]:0x1e167a
at wasm://wasm/02b6ddae:wasm-function[803]:0x18e943
at wasm://wasm/02b6ddae:wasm-function[3473]:0x2ad92d
Node.js v24.14.0
Error: Process completed with exit code 1.

Comment threadPlatforms/emscripten/streams.mjs Outdated
Comment threadPlatforms/emscripten/streams.mjs Outdated
Comment threadPlatforms/emscripten/streams.mjs Outdated
hoodmaneand others added 2 commits March 30, 2026 12:05
Co-authored-by: Victor Stinner <vstinner@python.org>
@hoodmane

Copy link
Copy Markdown
ContributorAuthor

Thanks for the review @vstinner!

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner
vstinner merged commit 6857de6 into python:mainMar 30, 2026
50 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @hoodmane for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 30, 2026
…_entry.mjs (pythonGH-146417)
(cherry picked from commit 6857de6)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app

Copy link
Copy Markdown

GH-146630 is a backport of this pull request to the 3.14 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.14 bugs and security fixes label Mar 30, 2026
@hoodmane
hoodmane deleted the streams branch March 30, 2026 11:28
vstinner added a commit that referenced this pull request Mar 30, 2026
…e_entry.mjs (GH-146417) (#146630)
gh-146416: Emscripten: Improve standard stream handling in node_entry.mjs (GH-146417)
(cherry picked from commit 6857de6)
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
maurycy added a commit to maurycy/cpython that referenced this pull request Mar 30, 2026
…ktor
* upstream/main: (119 commits)
pythongh-144270: Make SubElement parent and tag positional-only (pythonGH-144845)
pythongh-146558: JIT optimize dict access for objects with known hash (python#146559)
pythongh-139922: always run MSVC 64-bit tail-calling CI (pythonGH-146570)
pythongh-126835: Fix _PY_IS_SMALL_INT() macro (python#146631)
pythongh-146587: fix type slot assignment incase of multiple slots for same name (python#146593)
pythongh-138122: Add differential flame graph (python#145785)
pythongh-146416: Emscripten: Improve standard stream handling in node_entry.mjs (python#146417)
pythongh-146444: Don't package as part of iOS 'build hosts' target (python#146628)
pythongh-138850: Add --disable-epoll to configure (pythonGH-145768)
pythongh-146444: Make Platforms/Apple/ compatible with Python 3.9 (python#146624)
pythongh-138577: Fix keyboard shortcuts in getpass with echo_char (python#141597)
pythongh-146556: Fix infinite loop in annotationlib.get_annotations() on circular __wrapped__ (python#146557)
pythongh-146579: _zstd: Fix decompression options dict error message (python#146577)
pythongh-146083: Upgrade bundled Expat to 2.7.5 (python#146085)
pythongh-146080: fix a crash in SNI callbacks when the SSL object is gone (python#146573)
pythongh-146090: fix memory management of internal `sqlite3` callback contexts (python#146569)
pythongh-145876: Do not mask KeyErrors raised during dictionary unpacking in call (pythonGH-146472)
pythongh-146004: fix test_args_from_interpreter_flags on windows (python#146580)
pythongh-139003: Use frozenset for module level attributes in _pyrepl.utils (python#139004)
pythonGH-146527: Add more data to GC statistics and add it to PyDebugOffsets (python#146532)
...
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Apr 16, 2026
…_entry.mjs (python#146417)
Co-authored-by: Victor Stinner <vstinner@python.org>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…_entry.mjs (python#146417)
Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@hoodmane@vstinner