Skip to content

win, url: make fileURLToPath return backslashes#25324

Closed
bzoz wants to merge 1 commit into
nodejs:masterfrom
JaneaSystems:bartek-slash-fileurltopath
Closed

win, url: make fileURLToPath return backslashes#25324
bzoz wants to merge 1 commit into
nodejs:masterfrom
JaneaSystems:bartek-slash-fileurltopath

Conversation

@bzoz

@bzoz bzoz commented Jan 3, 2019

Copy link
Copy Markdown
Contributor

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
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@bzoz

bzoz commented Jan 3, 2019

Copy link
Copy Markdown
Contributor Author

@lpinca

lpinca commented Jan 3, 2019

Copy link
Copy Markdown
Member

Failures are related.

@guybedford guybedford left a comment

Copy link
Copy Markdown
Contributor

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.

const httpUrl = new URL('http://example.org');

// Check that the fileURLToPath uses platform separator
['file:///c:/tmp', 'file://tmp/tmp'].forEach((i) => {

Copy link
Copy Markdown
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

bzoz commented Jan 7, 2019

Copy link
Copy Markdown
Contributor Author

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