classification
Title: test_osx_env failing
Type: Stage:
Components: Tests Versions: Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: benjamin.peterson, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2009-03-02 23:17 by benjamin.peterson, last changed 2009-03-04 23:28 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
patch-nad0021-py3k-30.txt ned.deily, 2009-03-03 07:55
Messages (9)
msg83046 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-03-02 23:17
Mac OS 10.4 PPC debug build

test_osx_env
[31492 refs]
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: can't initialize sys standard streams
ImportError: No module named encodings.utf_8
test test_osx_env failed -- Traceback (most recent call last):
  File "/temp/python/py3k/Lib/test/test_osx_env.py", line 27, in
test_pythonexecutable_sets_sys_executable
    self._check_sys('PYTHONEXECUTABLE', '==', 'sys.executable')
  File "/temp/python/py3k/Lib/test/test_osx_env.py", line 24, in _check_sys
    self.assertEqual(rc, 2, "expected %s %s %s" % (ev, cond, sv))
AssertionError: expected PYTHONEXECUTABLE == sys.executable
msg83057 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-03-03 06:53
Is this a standard unix build or a framework build?
msg83059 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2009-03-03 07:06
It appears the test doesn't work correctly for non-framework builds, 
something I didn't test.  A patch is forthcoming.
msg83067 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2009-03-03 07:55
ANALYSIS    In a non-framework build, when PYTHONEXECUTABLE is set to a
            invalid value, getpath.c is unable to determine appropriate
            values for sys.prefix and sys.path so the interpreter fails
            in initialization.

SOLUTION    Simplify the test and supply appropriate values so the test
            works for both framework and non-framework builds.

APPLIES     py3k, 3.0
msg83147 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-03-04 22:06
Ned: IMHO your patch is not correct. test_osx_env tests behaviour that's 
only valid for a framework build, and should therefore only run when 
testing a framework build.

The easiest way to accomplish that is to change the test in 
test_osx_env.main to:

   if sys.platform == 'darwin' and 
sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'):

(with an "from distutils import sysconfig" statement just above the 
test).

I will commit this fix when I've actually tested it.
msg83158 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-03-04 22:59
Committed my fix as r70179 (3.x) and r70180 (30-maint).

Benjamin: can you confirm this actually fixes the issue with a non-
framework build, I don't know if I'll be able to test that before the 
first 3.1a release.
msg83160 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2009-03-04 23:05
I don't have strong feelings about it one way or the other.  As far as I 
can tell from the code and testing and the documented behavior, the effect 
on sys.executable is independent of whether it is a framework build or 
not.  But I'm fine with narrowing the scope of the test.
msg83162 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-03-04 23:12
The effect on sys.executable is always present, the test is only valid for 
a framework build because that's the only build that can find sys.prefix 
without looking at sys.executable.  Setting PYTHONEXECUTABLE with a non-
framework build is only valid if the value of the variable point's to a 
python executable in the right location within the installation tree.
msg83163 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-03-04 23:24
Thumbs up here! Thanks.
History
Date User Action Args
2009-03-04 23:28:45benjamin.petersonsetstatus: pending -> closed
2009-03-04 23:24:16benjamin.petersonsetmessages: + msg83163
2009-03-04 23:12:58ronaldoussorensetmessages: + msg83162
2009-03-04 23:05:48ned.deilysetmessages: + msg83160
2009-03-04 22:59:35ronaldoussorensetstatus: open -> pending
resolution: fixed
messages: + msg83158
2009-03-04 22:06:08ronaldoussorensetmessages: + msg83147
2009-03-03 07:55:50ned.deilysetfiles: + patch-nad0021-py3k-30.txt
messages: + msg83067
2009-03-03 07:06:09ned.deilysetmessages: + msg83059
2009-03-03 06:53:08ronaldoussorensetmessages: + msg83057
2009-03-02 23:52:25ned.deilysetnosy: + ned.deily
2009-03-02 23:17:05benjamin.petersoncreate