Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji in path breaks on windows using fs.readFile #49947

Closed
nicojs opened this issue Sep 29, 2023 · 3 comments
Closed

Emoji in path breaks on windows using fs.readFile #49947

nicojs opened this issue Sep 29, 2023 · 3 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform.

Comments

@nicojs
Copy link

nicojs commented Sep 29, 2023

Version

18.18.0

Platform

Microsoft Windows NT 10.0.19045.0 x64

Subsystem

No response

What steps will reproduce the bug?

import fs from "fs";

try {
  await fs.promises.open("./馃構");
} catch (e) {
  console.log("Custom error log", e);
}

How often does it reproduce? Is there a required condition?

Always on windows. Works as expected on Node 18.17.1, but not on Node 18.18.

What is the expected behavior? Why is that the expected behavior?

Custom error log [Error: ENOENT: no such file or directory, open './馃構'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: './馃構'
}

What do you see instead?

node:internal/fs/promises:590
    await binding.openFileHandle(pathModule.toNamespacedPath(path),
                  ^

Error: ENOENT: no such file or directory, open
    at Object.open (node:internal/fs/promises:590:19)
    at file:///C:/users/nicoj/github/tmp/index.js:4:21
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open'
}

Additional information

Note: also when the file exists in disk it crashes on Windows with the same error. Node 18.18.0 on linux works as expected.

@benjamingr
Copy link
Member

@anonrig this might be related to the perf improvements you worked on?

Also cc @nodejs/fs

@benjamingr benjamingr added fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform. labels Sep 29, 2023
@benjamingr
Copy link
Member

Hmm, looking at the v18.18 release I don't see anything related to the perf work actually? #49220

@richardlau richardlau added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Sep 29, 2023
@richardlau
Copy link
Member

This is a duplicate of #48673.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

3 participants