Skip to content

fs: fix realpath of namespaced drive paths - #65378

Open
jazelly wants to merge 1 commit into
nodejs:mainfrom
jazelly:fix-62446-1
Open

fs: fix realpath of namespaced drive paths#65378
jazelly wants to merge 1 commit into
nodejs:mainfrom
jazelly:fix-62446-1

Conversation

@jazelly

@jazelly jazelly commented Aug 18, 2026

Copy link
Copy Markdown
Member

The JavaScript realpath implementation probes a namespaced drive root through the fs binding. Windows path resolution drops the trailing separator from that probe, so lstat receives C: and reports EISDIR.

Use the regular drive-root spelling only for the probe. Preserve the namespaced spelling for traversal and returned paths.

Fixes: #62446


AI Disclaimer: I used AI to help me evaluate approaches. My initial attempt at #62639 was too breaking.

The JavaScript realpath implementation probes a namespaced drive root
through the fs binding. Windows path resolution drops the trailing
separator from that probe, so lstat receives C: and reports EISDIR.

Use the regular drive-root spelling only for the probe. Preserve the
namespaced spelling for traversal and returned paths.

Signed-off-by: Jason Zhang <xzha4350@gmail.com>
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Aug 18, 2026
@jazelly
jazelly marked this pull request as ready for review August 18, 2026 12:25
@jazelly jazelly added the windows Issues and PRs related to the Windows platform. label Aug 18, 2026
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.94737% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.12%. Comparing base (cf30b2e) to head (5750f39).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
lib/fs.js 78.94% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65378      +/-   ##
==========================================
+ Coverage   90.11%   90.12%   +0.01%     
==========================================
  Files         752      752              
  Lines      251861   251876      +15     
  Branches    47365    47362       -3     
==========================================
+ Hits       226955   227015      +60     
+ Misses      16238    16187      -51     
- Partials     8668     8674       +6     
Files with missing lines Coverage Δ
lib/fs.js 98.29% <78.94%> (-0.07%) ⬇️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node cannot handle extended windows paths

2 participants