[Python-Dev] Compiling 2.7.2 on OS/2 (original) (raw)

Paul Smedley paul at smedley.id.au
Fri Jan 6 08:12:46 CET 2012


Hi Terry,

On 06/01/12 10:25, Terry Reedy wrote:

On 1/5/2012 3:01 PM, Paul Smedley wrote:

File "./setup.py", line 1154, in detectmodules _for arg in sysconfig.getconfigvar("CONFIGARGS").split()] AttributeError: 'NoneType' object has no attribute 'split' make: *** [sharedmods] Error 1 File "./setup.py", line 1368, in detectmodules if '--with-system-expat' in sysconfig.getconfigvar("CONFIGARGS"): TypeError: argument of type 'NoneType' is not iterable make: *** [sharedmods] Error 1 Which again points to problems with sysconfig.getconfigvar("CONFIGARGS"): _[The earlier call was with "CONFIGARGS", for whatever difference that makes.] It appears to be returning None instead of [] (or a populated list). In 3.2.2, at line 579 of sysconfig.py is def getconfigvar(name): return getconfigvars().get(name) That defaults to None if name is not a key in the dict returned by getconfigvars(). My guess is that it always is and and the the value is always a list for tested win/*nix/mac systems. So either setup.py has the bug of assuming that there is always a list value for "CONFIGARGS" or sysconfig.py has the bug of not setting it for os2, perhaps because of a bug elsewhere. At line 440 of sysconfig.py is def getconfigvar(*args): global CONFIGVARS if CONFIGVARS is None: CONFIGVARS = {} <code to populate CONFIGVARS, including> if os.name in ('nt', 'os2'): initnonposix(CONFIGVARS) if args: vals = [] for name in args: vals.append(CONFIGVARS.get(name)) return vals else: return CONFIGVARS At 456 is def initnonposix(vars): """Initialize the module as appropriate for NT""" # set basic install directories ... "CONFIGARGS" is not set explicitly for any system anywhere in the file, so I do not know how the call ever works. This looks pretty much the same as the code in 2.7.2 - I don't understand Python code well enough to debug the script :(

Thanks for the response,

Paul



More information about the Python-Dev mailing list