nodejs / nodejs/node

fs: can't require non-ASCII file paths in Shift-JIS filesystem

Offen
#56,670 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

fs never-stale windows
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.4k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

Version

v22.13.0, v23.6.0

Platform
Microsoft Windows NT 10.0.26100.0 x64
Subsystem

fs

What steps will reproduce the bug?
  1. Use Japanese Windows with Shift-JIS (aka CP932)
  2. Load a non-ASCII file path with require such as ヘルプ.js
How often does it reproduce? Is there a required condition?

Always reproduceable under a Shift-JIS filesystem.

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

The file is loaded correctly.

What do you see instead?

"Process exited with code 3221225477"

Additional information
  • May be similar to https://github.com/nodejs/node/issues/56049, although it's an issue for a different method and doesn't mention the Shift-JIS requirement.
  • The issue was found in https://github.com/sapphiredev/pieces/issues/460 for reference, which used require in the user's case, the aforementioned issue also links a reproducible example repository, although not a minimal one for testing purposes, the issue has been reproduced with a simple require in REPL as well.
  • The same code works fine:
    • If the filesystem isn't Shift-JIS (UNIX, non-Japanese Windows).
    • ASCII names are used instead.
    • When run with an alternative runtime such as Deno.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne im fs-Subsystem, indem du den einfachen require-Fall unter Japanese Windows mit einem Shift-JIS-Dateisystem reproduzierst, und vergleiche ihn anschließend mit ASCII-Pfaden und Nicht-Shift-JIS-Systemen. Das verlinkte reproduzierbare Repository und der REPL-Fall bieten Ausgangsbeispiele. Erledigt ist es, wenn require einen Pfad mit Nicht-ASCII-Zeichen unter Shift-JIS erfolgreich lädt, ohne dass der gemeldete Prozess beendet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, nodejs
Bereich
operating-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.