Skip to content

test_half_float in test_struct fails on mips #143429

@chenx97

Description

@chenx97

Bug report

Bug description:

test test_struct failed -- Traceback (most recent call last):
  File "/usr/lib/python3.14/test/test_struct.py", line 946, in test_half_float
    self.assertEqual(packed[1] & 0x7e, expected)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 124 != 126

The test always asserts the 0x7e-masked higher byte of math.nan against 0x7e for MIPS. Unfortunately, math.nan depends on toolchain settings here, as setting -mnan=legacy and -mnan=2008 result in different __builtin_nan behavior for GCC, so the PA-RISC solution of picking 0x7c is inappropriate for MIPS. I think we can skip the NaN encoding assertions when platform.machine().startswith('mips') is true.

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-unsupportedtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions