[New-bugs-announce] [issue21016] trace: $prefix and $exec_prefix improperly replaced on Fedora

Ben Boeckel report at bugs.python.org
Sat Mar 22 04:46:20 CET 2014


New submission from Ben Boeckel:

In the --ignore-dir handling of trace.py, the following is done:

                s = s.replace("$prefix",
                              os.path.join(sys.base_prefix, "lib",
                                           "python" + sys.version[:3]))
                s = s.replace("$exec_prefix",
                              os.path.join(sys.base_exec_prefix, "lib",
                                           "python" + sys.version[:3]))

This does not do what is expected on 64-bit Fedora and newer Debian since the proper directory is /usr/lib64/python2.7 or /usr/lib/$triple/python2.7. Just the libsuffix can't be changed either since Fedora also has /usr/lib/python2.7 for arch-independent modules. It'd be nice if $prefix were replaced with the following directories from sysconfig.get_paths(): platstdlib, platlib, purelib, and stdlib.

It also erroneously replaces things like '$prefixpath'. It should probably do split the path on the path separators and only replace components that are equal to $prefix or $exec_prefix (so that the '$' can be escaped for directories named as such literally, but that would require a pass to parse the escapes).

----------
components: Library (Lib)
messages: 214435
nosy: mathstuf
priority: normal
severity: normal
status: open
title: trace: $prefix and $exec_prefix improperly replaced on Fedora
type: behavior
versions: Python 2.7, Python 3.3

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


More information about the New-bugs-announce mailing list