[New-bugs-announce] [issue24083] MSVCCompiler.get_msvc_path() doesn't work on Win x64

Marc-Andre Lemburg report at bugs.python.org
Thu Apr 30 17:15:48 CEST 2015


New submission from Marc-Andre Lemburg:

Trying to use .get_msvc_path() on an distutils.msvccompiler.MSVCCompiler() instance raises an AttributeError:

MSVCCompiler instance has no attribute '_MSVCCompiler__root'

The reason seems to be that self.__root is not set for Win x64 in .__init__().

Here's an example from Python 2.7.9:

>>> from distutils.msvccompiler import *
>>> c = OldMSVCCompiler()
>>> vars(c)
{'force': 0, 'verbose': 0, 'dry_run': 0, 'runtime_library_dirs': [], 'libraries': [], 'macros': [], 'objects': [], 'output_dir': None, '_MSVCCompiler__product': 'Microsoft SDK compiler 15.0', 'initialized': False, '_MSVCCompiler__arch': 'AMD64', '_MSVCCompiler__version': 9.0, 'library_dirs': [], 'include_dirs': []}
>>> c.get_msvc_paths('include')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Python27\lib\distutils\msvccompiler.py", line 615, in get_msvc_paths
    % (self.__root, self.__version))
AttributeError: MSVCCompiler instance has no attribute '_MSVCCompiler__root'

The newer implementation of MSVCCompiler in msvc9compiler doesn't have this method, so cannot be used to find the include and library paths.

----------
components: Distutils
messages: 242274
nosy: dstufft, eric.araujo, lemburg
priority: normal
severity: normal
status: open
title: MSVCCompiler.get_msvc_path() doesn't work on Win x64
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24083>
_______________________________________


More information about the New-bugs-announce mailing list