bpo-45375: Fix assertion failure due to searching for stdlib in unnormalised paths#28735
bpo-45375: Fix assertion failure due to searching for stdlib in unnormalised paths#28735zooba merged 3 commits intopython:mainfrom
Conversation
pablogsal
left a comment
There was a problem hiding this comment.
I only reviewed the C code, but unfortunately I am not acquainted with the semantics of this to understand if they are correct.
That's the problem with all of getpath - nobody is! 😂 At least it's only an alpha right now, and we'll likely work more on it before beta. |
|
|
|
||
| if (FAILED(PathCchCanonicalizeEx(buffer, MAXPATHLEN + 1, path, 0))) { | ||
| if (PathIsRelativeW(path)) { | ||
| wchar_t buff[MAXPATHLEN]; |
There was a problem hiding this comment.
This allocation should be MAXPATHLEN + 1. In this file, MAXPATHLEN refers to the string length of the path, without the terminating null.
Also ensures that when Python is run as part of build, it can locate the library in the source tree even when built out of tree.
https://bugs.python.org/issue45375