If binary is copied, prefix-finding could be broken

Carl Meyer avatarCarl Meyer created an issue

If we use a copied rather than symlinked binary, the finding of sys.prefix (in getpath.c) relies on falling back on the ./configure prefix. This might be broken in some situations, if the installation of Python that the virtualenv was created from has an incorrect ./configure prefix for some reason and was relying instead on the path-climbing behavior to find its sys.prefix, or if path-climbing from the location of the copied binary results in finding a valid (but incorrect) prefix.

Not sure yet how this can be fixed. It will probably require tweaks to getpath.c.

Comments (4)

  1. Carl Meyer

    Conclusion from distutils-sig is that yes, this needs to be fixed. It will require moving the config-file finding and parsing into C code, which means simplifying the config file spec (not full ConfigParser semantics), so as to be able to provide a "prefix hint" to copied binaries.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.