Skip to content

gh-155726: Restore the sysconfig prefix cache in test_sysconfig - #155729

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:test-sysconfig-config-vars-cache
Open

gh-155726: Restore the sysconfig prefix cache in test_sysconfig#155729
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:test-sysconfig-config-vars-cache

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 13, 2026

Copy link
Copy Markdown
Member

Save and restore sysconfig._config_vars_cached_prefix and sysconfig._config_vars_cached_exec_prefix in TestSysConfig.

test_sysconfig_config_vars_no_prefix_cache changes sys.prefix and calls
get_config_vars(), which caches the new prefix in module globals.
tearDown() restored sysconfig._CONFIG_VARS, but not those globals, so the
next get_config_vars() call found the cache stale and replaced
_CONFIG_VARS with a new dict.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant