-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
bpo-45720: Drop references to shlwapi #29417
Conversation
Ping @eryksun (and yes, I've applied the same change to my other PR which will delete this code) |
Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Sorry, @zooba, I could not cleanly backport this to |
Sorry @zooba, I had trouble checking out the |
@@ -265,7 +264,8 @@ canonicalize(wchar_t *buffer, const wchar_t *path) | |||
return _PyStatus_NO_MEMORY(); | |||
} | |||
|
|||
if (PathIsRelativeW(path)) { | |||
const wchar_t *pathTail; | |||
if (FAILED(PathCchSkipRoot(path, &pathTail)) || path == pathTail) { |
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.
Are you not worried at all that canonicalize()
will ever be called with paths that contain forward slashes? All of the PathCch*
functions handle forward slash as just a name character, in which case skipping the root, combining with current directory, and getting a canonical path all misbehave badly. It wouldn't hurt to add a wcschr()
call to check for forward slashes. Though another large buffer would have to be allocated on the stack in case path
has to be copied to modify it.
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.
Nah, it's shipped already and we'd have heard about issues if they exist. Plus #29041 is going to delete this code and replace it with code that handles both anyway.
GH-29435 is a backport of this pull request to the 3.10 branch. |
GH-29436 is a backport of this pull request to the 3.9 branch. |
(cherry picked from commit 804ea41) Co-authored-by: Steve Dower <[email protected]>
(cherry picked from commit 804ea41) Co-authored-by: Steve Dower <[email protected]> Co-authored-by: Steve Dower <[email protected]>
https://bugs.python.org/issue45720