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

win32 path.normalize change in behavior #18763

Closed
dougwilson opened this issue Feb 13, 2018 · 4 comments
Closed

win32 path.normalize change in behavior #18763

dougwilson opened this issue Feb 13, 2018 · 4 comments
Labels
question Issues that look for answers.

Comments

@dougwilson
Copy link
Member

dougwilson commented Feb 13, 2018

  • Version: v8.9.4
  • Platform: Windows 10 64-bit
  • Subsystem: path

So there seems to have been some change in path.normalize for win32 between Node.js 8.4.0 and 8.5.0 that changed how paths are being normalized. There seems to be a behavior difference with some paths that looked like drive-relative paths. Example:

> path.normalize(".\\C:../..")
'.'

Versions 8.4.0 and below used to do this:

> path.normalize(".\\C:../..")
'C:..\\..'

Is this an expected change?

@dougwilson dougwilson changed the title win32 path.normalize for drive-relative seems wrong win32 path.normalize change in behavior Feb 13, 2018
@BridgeAR
Copy link
Member

Refs: #14107

Ping @targos

@targos
Copy link
Member

targos commented Feb 14, 2018

I think we can say that it is expected.
The behavior present in versions <8.5.0 and <6.12.0 is the result of a bug that stayed for a long time without being noticed.
All releases of v4.x and v9.x return '.'.

FWIW, in Python, normpath(".\\C:../..") also returns '.'.

@dougwilson what is it breaking?

@dougwilson
Copy link
Member Author

Hi @targos there isn't anything specifically breaking here; there was a change in behavior of an application I have and tracked it down to this, and was not sure why it happened within a minor release, so just wanted to confirm it was intentional. The new behavior is correct vs the old behavior of course.

@BridgeAR BridgeAR added the question Issues that look for answers. label Feb 15, 2018
@BridgeAR
Copy link
Member

Closing as the question seems to be answered now.

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

No branches or pull requests

3 participants