[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

Steve Dower report at bugs.python.org
Thu Jan 4 20:44:42 EST 2018


Steve Dower <steve.dower at python.org> added the comment:

I agree that explicitly normalizing in PC/getpathp.c is the correct approach.

As far as I'm aware, GetModuleFileNameW(NULL) can never fail other than a buffer that is too small, so that whole function can probably be simplified to abort if it happens and just remove the PATH search.

Also, we should use a similar process for PathCchCanonicalizeEx as we already use for PathCchCombineExW in this file to avoid failing on earlier OS versions.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32457>
_______________________________________


More information about the Python-bugs-list mailing list