Skip to content

bpo-38453: Ensure ntpath.realpath correctly resolves relative paths#16967

Merged
zooba merged 6 commits into
python:masterfrom
zooba:bpo-38453
Nov 15, 2019
Merged

bpo-38453: Ensure ntpath.realpath correctly resolves relative paths#16967
zooba merged 6 commits into
python:masterfrom
zooba:bpo-38453

Conversation

@zooba

@zooba zooba commented Oct 28, 2019

Copy link
Copy Markdown
Member

@zooba

zooba commented Oct 28, 2019

Copy link
Copy Markdown
Member Author

@eryksun Would love your input on this one if you get a chance.

Comment thread Lib/ntpath.py
@zooba

zooba commented Nov 13, 2019

Copy link
Copy Markdown
Member Author

Okay, the latest push changes how we handle relative symlink targets. Only things reporting islink will be resolved if they're relative paths, otherwise we just don't traverse the mount point (unless the OS successfully did it, in which case this entire code path never executes).

This will change the result for broken links, as we can see in the test updates. It shouldn't affect links that exist, other than fixing the relative path issues we were seeing that were the cause of the bug in the first place (the new join(cwd, path) in realpath).

@zooba zooba merged commit abde52c into python:master Nov 15, 2019
@zooba zooba deleted the bpo-38453 branch November 15, 2019 17:49
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @zooba, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker abde52cd8e31830bfc06c5803221faae6172104a 3.8

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry @zooba, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker abde52cd8e31830bfc06c5803221faae6172104a 3.8

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @zooba, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker abde52cd8e31830bfc06c5803221faae6172104a 3.8

zooba added a commit to zooba/cpython that referenced this pull request Nov 15, 2019
…ythonGH-16967)

Ensure isabs() is always True for \\?\ prefixed paths
Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly
Ensure shutil tests run in test directory
@bedevere-bot

Copy link
Copy Markdown

GH-17174 is a backport of this pull request to the 3.8 branch.

zooba added a commit that referenced this pull request Nov 15, 2019
…H-16967)

Ensure isabs() is always True for \\?\ prefixed paths
Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly
Ensure shutil tests run in test directory
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
…ythonGH-16967)

Ensure isabs() is always True for \\?\ prefixed paths
Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly
Ensure shutil tests run in test directory
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…ythonGH-16967)

Ensure isabs() is always True for \\?\ prefixed paths
Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly
Ensure shutil tests run in test directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OS-windows type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants