Xavier de Gaye added the comment:
In the subprocess test named test_executable_without_cwd and when the test is
run on the installed Python, argv[0] is not the python executable and
calculate_path() in Modules/getpath.c, as a last resort, searches the
directories pointed to by the preprocessor
New submission from Xavier de Gaye:
The error messages:
running install_lib
creating /lib/python3.7
error: could not create '/lib/python3.7': Permission denied
make[1]: *** [Makefile:1449: sharedinstall] Error 1
The command that triggers this failure:
_PYTHON_PROJECT_BASE=/t