Skip to content

test_posix.test_makedev fails on Musl systems #138707

Description

@kraj

Bug report

Bug description:

This test depends on platform C library defining NODEV which is there on glibc but not on musl C library implementation on Linux. This is introduced with

#31794

Alpine has disabled portions of above patch to get it going on musl by applying this patch

diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 7ed45ac..a35c6db 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -724,7 +724,7 @@ def test_makedev(self):
             self.assertRaises((ValueError, OverflowError), posix.makedev, x, minor)
             self.assertRaises((ValueError, OverflowError), posix.makedev, major, x)

-        if sys.platform == 'linux':
+        if False:
             NODEV = -1
             self.assertEqual(posix.major(NODEV), NODEV)
             self.assertEqual(posix.minor(NODEV), NODEV)

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Sep 9, 2025
  2. zware commented on Sep 9, 2025

    @zware
    Member

    See gh-90548, and particularly GH-138593. This is "fixed" in 3.14 and 3.15, though I believe @serhiy-storchaka had plans to add an os.NODEV constant which could be used to properly test this rather than relying on a check for musl. We could go ahead and backport the test change to 3.13, but I'm unsure of its worth.

  3. kraj commented on Sep 9, 2025

    @kraj
    Author

    See gh-90548, and particularly GH-138593. This is "fixed" in 3.14 and 3.15, though I believe @serhiy-storchaka had plans to add an os.NODEV constant which could be used to properly test this rather than relying on a check for musl. We could go ahead and backport the test change to 3.13, but I'm unsure of its worth.

    ah thanks, I will test it with 3.13 in yocto and report back.

  4. zware commented on Sep 9, 2025

    @zware
    Member

    The change from GH-138593 is now merged on 3.13; GH-138713. I'll go ahead and close this as a duplicate of gh-90548.

  5. serhiy-storchaka commented on Sep 10, 2025

    @serhiy-storchaka
    Member

    though I believe @serhiy-storchaka had plans to add an os.NODEV constant which could be used to properly test this rather than relying on a check for musl.

    See #138712. It does not help in testing, because what we test (functions returning NODEV) is platform-specific and cannot be reproduced on all platforms that define NODEV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions