Skip to content

gh-151096: Fix test_embed with split exec prefix#151288

Open
harjothkhara wants to merge 1 commit into
python:mainfrom
harjothkhara:gh-151096-test-embed-split-prefix
Open

gh-151096: Fix test_embed with split exec prefix#151288
harjothkhara wants to merge 1 commit into
python:mainfrom
harjothkhara:gh-151096-test-embed-split-prefix

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Fix test_init_is_python_build_with_home for builds configured with different --prefix and --exec-prefix.

When running from the build directory on POSIX, getpath uses PREFIX for prefix/base_prefix and EXEC_PREFIX for exec_prefix/base_exec_prefix. The test expected both values to match sys.prefix, which fails for split-prefix builds.

This also updates module_search_paths() so its default exec_prefix comes from the expected config’s exec_prefix instead of prefix.

Validation:

  • Configured a local split-prefix build with --prefix=/private/tmp/cpython-151096-install --exec-prefix=/private/tmp/cpython-151096-install/exec.
  • Before the fix, ./python.exe -m test test_embed -v -m test_init_is_python_build_with_home failed with mismatched exec_prefix / base_exec_prefix.
  • After the fix, ./python.exe -m test test_embed -v -m test_init_is_python_build_with_home passes.
  • Full ./python.exe -m test test_embed -v passes.

This is a tests-only change; skip news.

@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jun 10, 2026
@harjothkhara

Copy link
Copy Markdown
Contributor Author

This is a tests-only change. Could a triager please add the skip news label?

@harjothkhara harjothkhara marked this pull request as ready for review June 10, 2026 23:09
@harjothkhara

Copy link
Copy Markdown
Contributor Author

This PR only touches Lib/test/test_embed.py — it adds a regression test for test_embed when the build uses a split exec prefix (gh-151096). There's no user-facing or behavioral change, so there's nothing to record in Misc/NEWS.d.

Could a core dev apply the skip news label so the bedevere/news check goes green? Happy to add a blurb instead if that's preferred.

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

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant