Xavier de Gaye <xdeg...@gmail.com> added the comment: Actually, sys.prefix is '/usr' because '/usr/bin' is in PATH while '/bin' is not in PATH. After adding '/bin' to the start of PATH, then sys.prefix becomes '/.' when Python is run as 'python3'. The confusion comes from the '/bin' symlink (archlinux is not a perfect choice for those tests). Whatever the value of PATH, '/bin/python3' has also '/.' as its sys.prefix.
So Modules/getpath.c fails to get '/' as the prefix in step 3 of the algorithm described at the top of the source code and uses '/.' (i.e. PREFIX) instead. This is caused by its reduce() function not handling the corner case where Python is installed on '/'. I will update the PR shortly. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31114> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com