GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-146416: Emscripten: Improve standard stream handling in node_entry.mjs by hoodmane · Pull Request #146417 · python/cpython

Conversation

@hoodmane

@hoodmane hoodmane commented Mar 25, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Emscripten: Improve standard stream handling in node_entry.mjs #146416

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hoodmane
pythongh-146416: Emscripten: Improve standard stream handling in node…
1e4e9c1
…_entry.mjs
@hoodmane
hoodmane requested review from AA-Turner, corona10, emmatyping and erlend-aasland as code owners March 25, 2026 13:13
@hoodmane hoodmane added OS-emscripten needs backport to 3.14 bugs and security fixes labels Mar 25, 2026
@hoodmane
hoodmane requested review from freakboy3742 and removed request for AA-Turner, corona10, emmatyping and erlend-aasland March 25, 2026 13:13
@bedevere-app bedevere-app Bot added the awaiting review label Mar 25, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Mar 25, 2026
Emscripten: Improve standard stream handling in node_entry.mjs #146416
Closed
@hoodmane hoodmane added the skip news label Mar 25, 2026
hoodmane added 3 commits March 25, 2026 14:48
@hoodmane
More accurate arg name
01f9307
@hoodmane
Remove debug log
5473107
@hoodmane
More consistent whitespace
34fc32a
@vstinner

vstinner commented Mar 25, 2026

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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hoodmane added 2 commits March 30, 2026 10:50
@hoodmane
Add nodeFsync definition
00efa5f
@hoodmane
Fix: rows first then columns
1a81834
vstinner
vstinner reviewed Mar 30, 2026
View reviewed changes
Comment thread Platforms/emscripten/streams.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Platforms/emscripten/streams.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Platforms/emscripten/streams.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

hoodmane and others added 2 commits March 30, 2026 12:05
@hoodmane @vstinner
Apply suggestions from code review
245cb86
Co-authored-by: Victor Stinner <[email protected]>
@hoodmane
Sleep only 10ms
36a307e
@hoodmane

hoodmane commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @vstinner!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner approved these changes Mar 30, 2026
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Mar 30, 2026
@vstinner
vstinner merged commit 6857de6 into python:main Mar 30, 2026
50 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Mar 30, 2026

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!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Mar 30, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 30, 2026
@hoodmane @vstinner @miss-islington
pythongh-146416: Emscripten: Improve standard stream handling in node…
2d93923
…_entry.mjs (pythonGH-146417)

(cherry picked from commit 6857de6)

Co-authored-by: Hood Chatham <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app

bedevere-app Bot commented Mar 30, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot 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
@miss-islington @hoodmane @vstinner
[3.14] gh-146416: Emscripten: Improve standard stream handling in nod…
ec11485
…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 <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
maurycy added a commit to maurycy/cpython that referenced this pull request Mar 30, 2026
@maurycy
Merge remote-tracking branch 'upstream/main' into tachyon-ndjson-kole…
6a0ea81
…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)
  ...
@pablogsal pablogsal mentioned this pull request Apr 4, 2026
gh-130273: Fix traceback color output with unicode characters #142529
Merged
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Apr 16, 2026
@hoodmane @vstinner @clin1234
pythongh-146416: Emscripten: Improve standard stream handling in node…
5d24496
…_entry.mjs (python#146417)

Co-authored-by: Victor Stinner <[email protected]>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@hoodmane @vstinner @ljfp
pythongh-146416: Emscripten: Improve standard stream handling in node…
5df80ab
…_entry.mjs (python#146417)

Co-authored-by: Victor Stinner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@freakboy3742 freakboy3742 Awaiting requested review from freakboy3742 freakboy3742 is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

OS-emscripten skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@hoodmane @vstinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.