Issue 21917: Python 2.7.7 Tests fail, and math is faulty (original) (raw)

Python is built with IBM XLC compiler, some tests fail and after installation mathematical executions are giving bad results. I corrected the _sysconfigdata.py bug () with ld_so_aix , and found this out when tried to install some modules.

Please see this other issue for the other tests: https://github.com/warner/python-ecdsa/issues/28

./configure --with-gcc="xlc_r -q64" AR="ar -X64" --prefix=/usr/local/Python-2.7.7_64_test

make

make test

running build_scripts find ./Lib -name '*.py[co]' -print | xargs rm -f ./python -Wd -3 -E -tt ./Lib/test/regrtest.py -l Traceback (most recent call last): File "./Lib/test/regrtest.py", line 220, in TEMPDIR = os.path.abspath(tempfile.gettempdir()) File "/tmp/Python-2.7.7/Lib/tempfile.py", line 269, in gettempdir tempdir = _get_default_tempdir() File "/tmp/Python-2.7.7/Lib/tempfile.py", line 197, in _get_default_tempdir fd = _os.open(filename, flags, 0o600) OverflowError: signed integer is greater than maximum make: 1254-004 The error code from the last command is 1. make: 1254-005 Ignored error code 1 from last command. ./python -Wd -3 -E -tt ./Lib/test/regrtest.py -l Traceback (most recent call last): File "./Lib/test/regrtest.py", line 220, in TEMPDIR = os.path.abspath(tempfile.gettempdir()) File "/tmp/Python-2.7.7/Lib/tempfile.py", line 269, in gettempdir tempdir = _get_default_tempdir() File "/tmp/Python-2.7.7/Lib/tempfile.py", line 197, in _get_default_tempdir fd = _os.open(filename, flags, 0o600) OverflowError: signed integer is greater than maximum make: 1254-004 The error code from the last command is 1.

Stop.

I just wanted to say that I am seeing the same issue with similar build flags for the xlc compiler.

Finding the correct compile flags may well be the problem here.

For the record, since I think this is related to the flags which are being passed to os.open, I've been looking at the following:

http://bugs.python.org/issue19749 https://github.com/pypa/pip/issues/849

I actually have access to a python2.7 which does work on this OS (which I didn't compile), which allowed me to identify the following difference:

$> ./python Python 2.7.8 [C] on aix7

import os; print os..O_NOFOLLOW 137438953472

$> /usr/bin/python Python 2.7.6 [C] on aix7

import os; print os.O_NOFOLLOW Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'O_NOFOLLOW'

My workaround therefore is to put the following in sitecustomize:

import os; os.dict.pop('O_NOFOLLOW', None)

And as a result "make test" no longer fails.

Any idea what it is we're missing in the configure step which is erroneously putting O_NOFOLLOW in os?