Ronald Oussoren <[email protected]> added the comment:
WITH_NEXT_FRAMEWORK is a compile time option, I've added it to globals in
values like PREFIX are added. That way the python code can behave differently
for framework builds (which appears to be needed).
There are two big problems with my patches:
- Calculation of sys.prefix doesn't work in test_venv_framework_macos, but
somehow works with a real installation. I haven't managed to track down the
difference yet.
- Calculation for test_framework_macos appears to be ok on first glance, but
adding "/Library/lib/python9.8.zip" as a known file shows that the code to look
for the stdlib is misbehaving.
The latter appears to be a wider problem, if I add a test case based on
test_normal_posix with PREFIX=/opt/python9.8 the getpath code looks for
/opt/lib/python98.zip and uses that when found.
Test case for this (test passed when
``ns.add_known_file("/opt/lib/python98.zip")`` is commented out:
def test_normal_posix_in_opt(self):
"""Test a 'standard' install layout on *nix
This uses '/opt/python9.8' as PREFIX
"""
ns = MockPosixNamespace(
PREFIX="/opt/python9.8",
argv0="python",
ENV_PATH="/usr/bin:/opt/python9.8/bin",
)
ns.add_known_xfile("/opt/python9.8/bin/python")
ns.add_known_file("/opt/python9.8/lib/python9.8/os.py")
ns.add_known_dir("/opt/python9.8/lib/python9.8/lib-dynload")
# This shouldn't matter:
ns.add_known_file("/opt/lib/python98.zip")
expected = dict(
executable="/opt/python9.8/bin/python",
base_executable="/opt/python9.8/bin/python",
prefix="/opt/python9.8",
exec_prefix="/opt/python9.8",
module_search_paths_set=1,
module_search_paths=[
"/opt/python9.8/lib/python98.zip",
"/opt/python9.8/lib/python9.8",
"/opt/python9.8/lib/python9.8/lib-dynload",
],
)
actual = getpath(ns, expected)
self.assertEqual(expected, actual)
This could be problematic, adding a suitably named file outside of $PREFIX
breaks the python installation. I haven't checked this with an unchanged
getpath.py yet, but I shouldn't have made any changes that affect a
non-framework install.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46890>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com