-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Description
There's code duplication between stat.py and _stat.c and a large subset of that is in definitions that are at least in theory platform dependent.
The C file also contains a lot a local fallback definitions of constants, like:
#ifndef S_IROTH
# define S_IROTH 00004
#endifSome of these are not really useful, e.g.:
#ifndef S_IFDOOR
# define S_IFDOOR 0
#endifWe don't do this in other modules, and these fallback definition make it harder to determine which constants are relevant for the current platform.
Proposal:
- Remove the definition of platform constants from
stat.py - Remove fallback definitions in
_stat.cand export only those names that are actually available on platforms - Add explicit tests for those constants that we require to be available on all platforms
The 2nd bullet might break backward compatibility by removing flags on platforms that don't have them (in particular flags like UF_NODUMP that are likely only available on BSDs).
erlend-aasland and serhiy-storchaka
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory