Skip to content

Commit

Permalink
On mac, calling fsync on stdout/stderr when not isatty returns ENOTSUP (
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane authored Feb 25, 2025
1 parent 10bb8f3 commit 10677a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/project/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ myst:
- {{ Fix }} `mountNativeFS` API now correctly propagates the error. {pr}`5434`
- {{ Fix }} `registerJsModule()` now works with non-extensible JS objects, such
as ES6 modules. {pr}`5452`
- {{ Fix }} The Pyodide CLI runner now works correctly on macs when stdout is
not a tty. {pr}`5430`
- {{ Fix }} Since 0.27.1, Pyodide has been broken in iOS because iOS ships
broken wasm-gc support. Pyodide feature detects whether the runtime supports
wasm-gc and uses it if it is present. Unfortunately, iOS passes the feature
Expand Down
6 changes: 5 additions & 1 deletion src/js/streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ function nodeFsync(fd: number): void {
try {
fs.fsyncSync(fd);
} catch (e: any) {
if (e && e.code === "EINVAL") {
if (e?.code === "EINVAL") {
return;
}
// On mac, calling fsync on stdout/stderr when not isatty returns ENOTSUP
if (e?.code === "ENOTSUP" && (fd === 1 || fd === 2)) {
return;
}
throw e;
Expand Down

0 comments on commit 10677a4

Please sign in to comment.