-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
win, url: make fileURLToPath return backslashes #25324
Conversation
Makes fileURLToPath use backslashes as path separator on Windows Fixes: nodejs#25265
Failures are related. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix.
@@ -30,6 +30,17 @@ fs.readFile(url, common.mustCall((err, data) => { | |||
// Check that using a non file:// URL reports an error | |||
const httpUrl = new URL('http://example.org'); | |||
|
|||
// Check that the fileURLToPath uses platform separator | |||
['file:///c:/tmp', 'file://tmp/tmp'].forEach((i) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem seems to be the file://tmp/tmp
entry here being treated as invalid. Perhaps just make it file:///tmp/tmp
?
Closing, #25349 has better tests. |
Makes
fileURLToPath
use backslashes as path separator on WindowsFixes: #25265
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes