GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_sysconfig leaves the sysconfig prefix cache modified · Issue #155726 · python/cpython

test_sysconfig leaves the sysconfig prefix cache modified #155726

New issue
Copy link
New issue
Copy link
Closed
Closed
test_sysconfig leaves the sysconfig prefix cache modified#155726
Copy link
Labels
3.16new features, bugs and security fixesnew features, bugs and security fixestestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@serhiy-storchaka
serhiy-storchaka
opened on Aug 13, 2026
Issue body actions

Bug report

TestSysConfig.tearDown() restores sysconfig._CONFIG_VARS, but not sysconfig._config_vars_cached_prefix and sysconfig._config_vars_cached_exec_prefix.

test_sysconfig_config_vars_no_prefix_cache sets sys.prefix to 'prefix-BBB' and calls get_config_vars(), so the cached prefix keeps that value after the test. The next get_config_vars() call finds the cache stale and replaces _CONFIG_VARS with a new dict:

cached prefix before: /usr/local
cached prefix after : prefix-BBB
rebuilt: True

regrtest reports this as Warning -- sysconfig._CONFIG_VARS was modified by test_sysconfig, because its own check calls sysconfig.get_config_var('prefix') before comparing:

$ ./python -m test --fail-env-changed test_sysconfig -m test_sysconfig_config_vars_no_prefix_cache
Result: ENV CHANGED

Linked PRs

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

Activity

  1. serhiy-storchaka
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    3.16new features, bugs and security fixesnew features, bugs and security fixes
    on Aug 13, 2026
  2. serhiy-storchaka
    added a commit that references this issue on Aug 14, 2026

    gh-155726: Restore the sysconfig prefix cache in test_sysconfig (GH-1…

    b42025d
  3. serhiy-storchaka
    closed this as completedon Aug 14, 2026
  4. mbeijen
    added a commit that references this issue on Aug 14, 2026

    pythongh-155726: Restore the sysconfig prefix cache in test_sysconfig (…

    a57f65b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.16new features, bugs and security fixesnew features, bugs and security fixestestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.