PARTIAL SOLUTION: Compiling Python 2.2 with GCC in HPUX 10.20 does not work

Michael Piotrowski mxp at dynalabs.de
Fri Mar 8 15:40:50 EST 2002


pekka niiranen <krissepu at vip.fi> writes:

> 9)    When running "gmake test", I still get error:
>
>     test test_fpformat failed -- Traceback (most recent call last):
>       File "./Lib/test/test_fpformat.py", line 51, in test_reasonable_values
>         self.checkFix(realVal, d)
>       File "./Lib/test/test_fpformat.py", line 28, in checkFix
>         self.assertEquals(result, expected)
>       File
>       "/osasto/home/niirape/python_softa/Python-2.2/Lib/unittest.py",
>       line 286, in failUnlessEqual
>         raise self.failureException, \
>     AssertionError: '-0' != '0'

I've had a look at test_fpformat: The test expects that

   "%.*f" % (0, -0.003)

produces -0 (negative zero), but on HP-UX 10.20, this yields 0.  It
seems that, according to IEEE, -0 would be correct, and this is indeed
what you get on HP-UX 11.

This is basically a, ahem, property of the 10.20 libc; I don't think
there's anything reasonable one could do about it.  Also, apart from
the test, I'd think that this has any impact on Python.  If you need
the "correct" behavior, the best idea might be to upgrade to 11.

You might also want to have a look at

<http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x3f0ecb60e503d6118ff40090279cd0f9,00.html>

According to this posting, Solaris 7 and AIX 4.3 seem to behave in the
same way as HP-UX 10.20, so test_fpformat should fail on these
platforms, too.

-- 
Michael Piotrowski, M.A.                                  <mxp at dynalabs.de>



More information about the Python-list mailing list