Repository navigation
fix: handle non-ASCII asar paths without a UTF-8 locale - #54655
Conversation
IsArchivePrefix() built its FilePath with FromUTF8Unsafe(), which on Linux decodes through the C library locale and returns an empty path for non-ASCII input when that locale is not UTF-8. An archive under such a folder was then not recognized, so a main process started with no locale or LC_ALL=C could not load its app, and ELECTRON_RUN_AS_NODE children such as child_process.fork() could not read the archive under any locale. Use the path bytes directly on POSIX. Assisted-By: Claude Opus 5.5, Claude Code
|
💖 Thanks for opening this pull request! 💖 Semantic PR titlesWe use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of commit messages with semantic prefixes:
Commit signingThis repo enforces commit signatures for all incoming PRs. PR tipsThings that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
|
Suggested release note (advisory) The
This suggestion was generated automatically, so use your best judgment. This comment will update as the PR description is edited. |
Co-authored-by: Charles Kerr <[email protected]>
|
I applied both suggestions in bc4af0b. Without the fix, the Node mode test still fails with ENOTDIR under en_US.UTF-8 now that |
|
Release Notes Persisted
|
|
Congrats on merging your first pull request! 🎉🎉🎉 |
|
I have automatically backported this PR to "45-x-y", please check out #54848 |
|
I have automatically backported this PR to "44-x-y", please check out #54849 |
Description of Change
Fixes #54638.
On Linux,
IsArchivePrefix()built itsFilePathwithFromUTF8Unsafe(), which goes through the C library locale and returns an empty path for non-ASCII input unless that locale is UTF-8. Since #53852 an archive under a folder like~/Téléchargementsis then not recognized, so a main process started without a UTF-8 locale can't load its app, andchild_process.fork()children can't read the archive under any locale. This uses the path bytes directly on POSIX.The new specs run with
LC_ALL=C, in Node mode and as an app, and fail without the fix.Non-ASCII entry names loaded through
file:URLs also fail underLC_ALL=C, already on 44.4.2, so I've left that for a separate PR.Checklist
npm testpassesRelease Notes
Notes: Fixed asar archives in non-ASCII folders failing to load on Linux.