This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Joshua.J.Cogliati
Recipients Alexander.Sulfrian, Joshua.J.Cogliati, Xuefer.x, eric.araujo, jrincayc, tarek
Date 2015-02-23.18:09:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I can confirm this bug on Python 2.7.8 and Python 3.4.1, and given that the code is still in later versions, I expect that it will fail in them as well.

From Python-3.4.2/Lib/distutils/, lines 179-189:
# skip over environment variable settings if /usr/bin/env
# is used to set up the linker's environment.
# This is needed on OSX. Note: this assumes that the
# normal and C++ compiler have the same environment
# settings.
i = 0
if os.path.basename(linker[0]) == "env":
    i = 1
    while '=' in linker[i]:
        i += 1
linker[i] = self.compiler_cxx[i]

First of all, as has been noted, this will fail if len(self.compiler_cxx) > 1.  

Second of all, I do not understand how this code was supposed to work correctly in the first place.  If env is in linker[0], then variable i will be greater than 0, so why are we then using self.compiler_cxx[i]?

As I understand the code, I should be able to do something like:
export CXX="env BAR=FOO g++"
and then have env work.  However, when I tried this, my python build failed.

However, if I do something like:
if target_lang == "c++" and self.compiler_cxx and False:
to the line in, then I can do:
export CXX="env BAR=FOO g++"
in the shell and have it compile.  I don't know if it would work if I actually needed BAR=FOO, but so far as I can tell this code is broken, and has been for a while, and therefore should be flat out removed.
Date User Action Args
2015-02-23 18:09:18Joshua.J.Cogliatisetrecipients: + Joshua.J.Cogliati, tarek, eric.araujo, jrincayc, Xuefer.x, Alexander.Sulfrian
2015-02-23 18:09:18Joshua.J.Cogliatisetmessageid: <>
2015-02-23 18:09:18Joshua.J.Cogliatilinkissue8027 messages
2015-02-23 18:09:18Joshua.J.Cogliaticreate