-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
gh-138712: Add os.NODEV #138728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
gh-138712: Add os.NODEV #138728
Conversation
7063cfd
to
2ba5b75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document the new constant in https://docs.python.org/dev/whatsnew/3.15.html#improved-modules ?
.. data:: NODEV | ||
|
||
Non-existent device. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind to add a .. versionadded:: next
markup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed this? Thank you for noticing.
if (hasattr(posix, 'NODEV') and | ||
sys.platform.startswith(('linux', 'macos', 'freebsd', 'dragonfly', | ||
'sunos'))): | ||
NODEV = posix.NODEV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code path still skipped on Alpine Linux (musl)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is skipped if NODEV is not defined in musl. But if it is defined, the following tests will fail, so we will need to add an additional condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is too minor. I don't think it deserves a separate What's New entry. I am not sure that What's New entries were added for every new constant.
.. data:: NODEV | ||
|
||
Non-existent device. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed this? Thank you for noticing.
if (hasattr(posix, 'NODEV') and | ||
sys.platform.startswith(('linux', 'macos', 'freebsd', 'dragonfly', | ||
'sunos'))): | ||
NODEV = posix.NODEV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is skipped if NODEV is not defined in musl. But if it is defined, the following tests will fail, so we will need to add an additional condition.
📚 Documentation preview 📚: https://cpython-previews--138728.org.readthedocs.build/