This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Ray Donnelly
Recipients Ray Donnelly, paul.moore, steve.dower, tim.golden, zach.ware
Date 2017-12-30.18:58:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514660312.79.0.213398074469.issue32457@psf.upfronthosting.co.za>
In-reply-to
Content
Over on the Anaconda Distribution we received a (private) bug report about a crash when trying to use scons. I thought initially it was due to one of our patches but I tested it out with official CPython and also with WinPython and ran into the same crash.

To reproduce this, from cmd.exe on CPython (here I installed CPython as part of Visual Studio 2017, then updated it to the latest 3.6.4 release):

```
set "PATH=C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts\..;%PATH%"

python.exe

..

python
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00000328 (most recent call first):
```

The trigger for this bug is the following batch code in scons.bat:

https://bitbucket.org/scons/scons/src/c0172db149b1a151eeb76910d55c81746bfede05/src/script/scons.bat?at=default&fileviewer=file-view-default#scons.bat-19

My current thinking is that the best fix here is to modify get_progpath()/get_program_full_path() so that it uses PathCchCanonicalizeEx() at https://github.com/python/cpython/blob/9bee329130aae5a13050c08dab9d349b76e66835/PC/getpathp.c#L558-L559
History
Date User Action Args
2017-12-30 18:58:32Ray Donnellysetrecipients: + Ray Donnelly, paul.moore, tim.golden, zach.ware, steve.dower
2017-12-30 18:58:32Ray Donnellysetmessageid: <1514660312.79.0.213398074469.issue32457@psf.upfronthosting.co.za>
2017-12-30 18:58:32Ray Donnellylinkissue32457 messages
2017-12-30 18:58:32Ray Donnellycreate