I think 3.12-only change is OK. Since we’re already build python from source, we can workaround this with a patch in 3.11.
For the change, I did a test. First I changed the zip file path calculation to this:
if prefix:
pythonpath.append(joinpath(prefix, ZIP_LANDMARK))
else:
pythonpath.append(joinpath(PREFIX, ZIP_LANDMARK))
Then, two test cases will fail. test_embed and test_getpath.
Then I tried simply removing the venv condition like this:
# Then add the default zip file
if os_name == 'nt':
# QUIRK: Windows uses the library directory rather than the prefix
if library:
library_dir = dirname(library)
else:
library_dir = executable_dir
pythonpath.append(joinpath(library_dir, ZIP_LANDMARK))
elif build_prefix:
# QUIRK: POSIX uses the default prefix when in the build directory
pythonpath.append(joinpath(PREFIX, ZIP_LANDMARK))
else:
pythonpath.append(joinpath(prefix, ZIP_LANDMARK))
now all tests passed. This may be the simplest change?