Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

bzoz
Copy link
Contributor

@bzoz bzoz commented Jan 3, 2019

Makes fileURLToPath use backslashes as path separator on Windows

Fixes: #25265

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Makes fileURLToPath use backslashes as path separator on Windows

Fixes: nodejs#25265
@bzoz
Copy link
Contributor Author

bzoz commented Jan 3, 2019

@lpinca
Copy link
Member

lpinca commented Jan 3, 2019

Failures are related.

Copy link
Contributor

@guybedford guybedford left a 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) => {
Copy link
Contributor

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?

@bzoz
Copy link
Contributor Author

bzoz commented Jan 7, 2019

Closing, #25349 has better tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fileURLToPath returns forward slashes on Windows
5 participants