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 TBBle
Recipients TBBle
Date 2008-08-31.17:14:46
SpamBayes Score 1.1948519e-05
Marked as misclassified No
Message-id <1220202889.53.0.172923498575.issue3741@psf.upfronthosting.co.za>
In-reply-to
Content
Basically, if DISTUTILS_USE_SDK is set in the environment and an
extension is attempted to be built from within the Windows SDK shell
(ie. MSSdk is set in the environment as well), msvc9compiler.py will
raise an exception due to a reference to the undefined self.__paths in
MSVCCompiler.find_exe class, called from MSVCCompiler.initialize.

self.__paths is used both in MSVCCompiler.find_exe and further through
MSVCCompiler.initialize, but only exists if the else branch of the
DISTUTILS_USE_SDK if/else is taken.

I've attached a patch which trivially fixes this by setting self.__paths
to [] before the test for DISTUTILS_USE_SDK.

However, the use of MSVCCompiler.find_exe in this test might be wrong.
Short of raising an exception, MSVCCompiler.find_exe always returns what
it is supplied if it can't find anything better. So testing the truth of
this value is likely incorrect. (I assume that find_exe used to return a
false value if the requested program could not be found on the path or
in self.__paths[]...)

If the find_exe is removed from the test, then the setting of
self.__paths can be done inside the if branch, paralleling the else branch.
History
Date User Action Args
2008-08-31 17:14:49TBBlesetrecipients: + TBBle
2008-08-31 17:14:49TBBlesetmessageid: <1220202889.53.0.172923498575.issue3741@psf.upfronthosting.co.za>
2008-08-31 17:14:48TBBlelinkissue3741 messages
2008-08-31 17:14:47TBBlecreate