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 pythonhacker
Recipients pythonhacker
Date 2015-03-23.09:13:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427101982.73.0.589713060591.issue23746@psf.upfronthosting.co.za>
In-reply-to
Content
On Python 3.5.0a1+ built from source,

>>> import sysconfig
>>> sysconfig.is_python_build()
False
>>> sysconfig.is_python_build(True)
False
>>> sysconfig._PROJECT_BASE
'/opt/bin'
>>> import sys
>>> sys._home
>>>

The problem is, when sys._home is None, this function uses _is_python_source_dir(_PROJECT_BASE) . In this case the _PROJECT_BASE is clearly passed wrongly as '/opt/bin'. That is the INSTALL_PREFIX, not _PROJECT_BASE .

Let us do a small hack and set _PROJECT_BASE to the folder where I build this Python version.

# Of course this can't be reproduced but you get the idea.

>>> sysconfig._PROJECT_BASE='/home/anand/code/cpython/'
>>> sysconfig.is_python_build()
True

The documentation says,

"

sysconfig.is_python_build()

    Return True if the current Python installation was built from source.

"

which is clearly in conflict with what it is doing. 

From a quick look at sysconfig.py it looks like it is calculating _PROJECT_BASE wrongly. 

I can give a patch for this, but first I am more interested in finding out what this function is supposed to do - why have this function if you are not able to get the details of the build environment from the built interpreter ? Clearly it is not doing that here.



The conclusions are part of the attached file in comments.
History
Date User Action Args
2015-03-23 09:13:02pythonhackersetrecipients: + pythonhacker
2015-03-23 09:13:02pythonhackersetmessageid: <1427101982.73.0.589713060591.issue23746@psf.upfronthosting.co.za>
2015-03-23 09:13:02pythonhackerlinkissue23746 messages
2015-03-23 09:13:02pythonhackercreate