Documentation
One the one hand, the os.chmod documentation says that Windows only supports stat.S_IWRITE and stat.S_IREAD.
But on the other hand, the stat module documentation says that both of those (S_IWRITE and S_IREAD) are Unix V7 synonyms for S_IWUSR and S_IRUSR (and in fact comments in the stat code say the same thing).
That's confusing. One piece of documentation says Windows supports them (in fact, only them) and another piece of documentation says they're for Unix (i.e. not Windows).
The naming "IWUSR" and "IRUSR" implies the typical Unix permission model, which does not apply on Windows, so it makes sense that Windows code should ideally not use S_IWUSR or S_IRUSR (even though the code would happen to work because the values are identical to S_IWRITE and S_IREAD).
Therefore, I think the fix should be to replace the "Unix V7 synonym for ..." statements with "Unix V7 synonym for ..., also used on Windows" in both of the following:
- comments in the
stat module code
- statements in the
stat documentation
Linked PRs
Documentation
One the one hand, the
os.chmoddocumentation says that Windows only supportsstat.S_IWRITEandstat.S_IREAD.But on the other hand, the
statmodule documentation says that both of those (S_IWRITEandS_IREAD) are Unix V7 synonyms forS_IWUSRandS_IRUSR(and in fact comments in thestatcode say the same thing).That's confusing. One piece of documentation says Windows supports them (in fact, only them) and another piece of documentation says they're for Unix (i.e. not Windows).
The naming "IWUSR" and "IRUSR" implies the typical Unix permission model, which does not apply on Windows, so it makes sense that Windows code should ideally not use
S_IWUSRorS_IRUSR(even though the code would happen to work because the values are identical toS_IWRITEandS_IREAD).Therefore, I think the fix should be to replace the "Unix V7 synonym for ..." statements with "Unix V7 synonym for ..., also used on Windows" in both of the following:
statmodule codestatdocumentationLinked PRs