[issue22140] "python-config --includes" returns a wrong path (double prefix)

Michael Dussere report at bugs.python.org
Tue Aug 5 15:28:32 CEST 2014


New submission from Michael Dussere:

Our python is installed on a shared directory that is accessed through a symbolic link. 
$ which python3.4-config
/Produits/publics/x86_64.Linux.RH6/python/3.4.1/bin/python3.4-config

$ ls -al /Produits
lrwxrwxrwx 1 root root 13 Oct 31  2013 /Produits -> /nfs/Produits

With this configuration python-config returns a wrong path (it gives a double /nfs prefix)

$ python3.4-config --includes
-I/nfs/nfs/Produits/publics/x86_64.Linux.RH6/python/3.4.1/include/python3.4m -I/nfs/nfs/Produits/publics/x86_64.Linux.RH6/python/3.4.1/include/python3.4m


The problem is due to a double string replacement in the script

   prefix_build="/Produits/publics/x86_64.Linux.RH6/python/3.4.1"
   prefix_real=$(installed_prefix "$0")

   # Use sed to fix paths from their built-to locations to their installed-to
   # locations.
   prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
   exec_prefix_build="${prefix}"
   exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#")
   includedir=$(echo "${prefix}/include" | sed "s#$prefix_build#$prefix_real#")

for $includedir the replacement of $prefix_build by $prefix_real is applyed twice and since the $prefix_real contains $prefix_build it produce a wrong result.

In addition I think it is strange to have lines like the following
prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")

----------
components: Demos and Tools
messages: 224825
nosy: Michael.Dussere
priority: normal
severity: normal
status: open
title: "python-config --includes" returns a wrong path (double prefix)
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22140>
_______________________________________


More information about the Python-bugs-list mailing list