Skip to content

posixmodule.c doesn't detect xattr support on Linux with non-glibc (e.g. musl) #101857

Closed

Description

@thesamesam

Bug report

posixmodule.c detects xattr support by checking for __GLIBC__ (and some other conditions) at

#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
. This incorrectly excludes the musl libc,which supports xattr functionality.

On a musl system, it's easy to reproduce with:

>>> import os
>>> os.listxattr 
Traceback (most recent call last): 
	File "", line 1, in
AttributeError: module 'os' has no attribute 'listxattr'

Your environment

Linked PRs

Activity

  1. added a commit that references this issue on Feb 12, 2023
  2. added a commit that references this issue on Feb 14, 2023
  3. added a commit that references this issue on Feb 14, 2023
  4. added
    buildThe build process and cross-build
    on Feb 14, 2023
  5. self-assigned this
    on Feb 14, 2023
  6. added a commit that references this issue on May 21, 2023
  7. added 2 commits that reference this issue on May 21, 2024
  8. added 2 commits that reference this issue on Sep 19, 2024
  9. added a commit that references this issue on Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buildThe build process and cross-buildextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions