nodejs / nodejs/node

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

オープン
#56,670 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

fs never-stale windows
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

fs サブシステムから始め、Shift-JIS のファイルシステムを使用する Japanese Windows で説明されている単純な require ケースを再現し、その後 ASCII パスおよび Shift-JIS 以外のシステムと比較します。リンクされている再現用リポジトリと REPL ケースが開始点となる例を提供します。Shift-JIS 環境で require が非 ASCII パスを正常に読み込み、報告されているプロセス終了が発生しなければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, nodejs
領域
operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。