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.

Bewertung

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

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.

Beschreibung

fs never-stale windows
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.
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.4k
Ø Merge
4 T. 3 Std.
Gemergte PRs (30 T.)
272

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nodejs/node

Alle Issues in nodejs/node

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

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