[New-bugs-announce] [issue9143] test_ctypes: fails on sparc64 long double

Jan Engelhardt report at bugs.python.org
Fri Jul 2 14:51:31 CEST 2010

New submission from Jan Engelhardt <jengelh at medozas.de>:

When python is compiled with sparc64 settings (i.e. -m64), test_ctypes fails. I am not sure why this does not show up with -m32.

ares:/usr/src/packages/BUILD/Python-2.6.5> LD_LIBRARY_PATH=/usr/src/packages/BUILD/Python-2.6.5 ./python -E -tt ./Lib/test/regrtest.py -s test_ctypes
test test_ctypes failed -- Traceback (most recent call last):
  File "/usr/src/packages/BUILD/Python-2.6.5/Lib/ctypes/test/test_callbacks.py", line 81, in test_longdouble
    self.check_type(c_longdouble, 3.14)
  File "/usr/src/packages/BUILD/Python-2.6.5/Lib/ctypes/test/test_callbacks.py", line 30, in check_type
    self.failUnlessEqual(self.got_args, (-3, arg))
AssertionError: (-3, 0.0) != (-3, 3.1400000000000001)

When using "long double x = 3.14", the constant 3.14 is taken as a double, which is then converted to long double. Of course it isn't accurate. There must be something in python that doesn't generate this correctly; it should have been "long double x = 3.14L", since only the constant 3.14L expands to the full longdouble pi.

components: Tests
messages: 109107
nosy: jengelh
priority: normal
severity: normal
status: open
title: test_ctypes: fails on sparc64 long double
type: behavior
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list