You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sysconfig.get_config_vars() values always get overwritten with the values from Makefile #126920
When fixing GH-126789, I noticed the exec and exec_prefix keys from sysconfig.get_config_vars() always get set to the value from Makefile, instead of following sys.prefix and sys.exec_prefix.
This happens because, after we set the values from sys.prefix and sys.exec_prefix in sysconfig._init_config_vars(), sysconfig._init_posix() updates the dictionary with the values from the Makefile, overwriting any values we set previously,
From my testing, exec and exec_prefix seem to be only the only keys currently affected, and fortunately they aren't used to calculate any of the sysconfig.get_paths() paths, which is probably why we didn't notice earlier.
I should also note that since the sys values only differ from the ones in the Makefile on virtual environments, this bug only happens inside virtual environments.
That said, the current code makes things super fragile. Just creating a variable name base in the Makefile, for eg., would majorly break sysconfig.get_paths() in virtual environments.
The fix is pretty simple, the values from the Makefile should not overwrite any of the values we previously set.
Activity
pythonGH-126920: fix sysconfig.get_config_vars getting overwriten fro…
pythonGH-126920: fix Makefile overwriting sysconfig.get_config_vars
GH-126920: fix Makefile overwriting sysconfig.get_config_vars
pythonGH-126920: fix Makefile overwriting sysconfig.get_config_vars
pythonGH-126920: fix Makefile overwriting sysconfig.get_config_vars