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.

classification
Title: test_distutils fails - sysconfig._config_vars is None
Type: behavior Stage:
Components: Distutils Versions: Python 3.0, Python 3.1, Python 2.7, Python 2.6
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: srid, tarek, trentm
Priority: normal Keywords:

Created on 2009-04-22 01:00 by srid, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg86266 - (view) Author: Sridhar Ratnakumar (srid) Date: 2009-04-22 01:00
Sorry, but the commit r69598 (due to Issue4524) has a problem. On
Windows and Linux (although not on MacOSX), test_distutils fails:

test_distutils
test test_distutils failed -- Traceback (most recent call last):
  File "C:\Python26\lib\distutils\tests\test_build_scripts.py", line 93,
in test_version_int
    old = sysconfig._config_vars.get('VERSION')
AttributeError: 'NoneType' object has no attribute 'get'


Using the documented API (`sysconfig.get_config_vars()`) instead of an
uninitialized private variable (`sysconfig._config_vars.get('VERSION')`)
may fix it.


The following session is from my a Windows machine:

>>> from distutils import sysconfig
>>> print sysconfig._config_vars
None
>>> s = sysconfig.get_config_vars()
>>> s
{'EXE': '.exe', ...}
>>> sysconfig._config_vars
{'EXE': '.exe', ...}
>>>

We face this failure while testing the ActivePython builds based on
Python 2.6.2.
msg86280 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-04-22 08:36
While your fix proposal is accurate, _config_vars is initialized in the
test framework because it is used by various part.

I was unable to reproduce your issue, how do you do ?
msg86502 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-04-25 12:59
Applied in r71884 (r71887) and r71886 (r71889) nevertheless
History
Date User Action Args
2022-04-11 14:56:48adminsetgithub: 50060
2009-04-25 12:59:02tareksetstatus: open -> closed

messages: + msg86502
2009-04-22 08:36:56tareksetmessages: + msg86280
versions: + Python 3.0, Python 3.1, Python 2.7
2009-04-22 01:00:40sridcreate