Skip to content

gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} #107486

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

Merged
merged 13 commits into from
Aug 27, 2023
Merged

gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} #107486

merged 13 commits into from
Aug 27, 2023

Conversation

qqwqqw689
Copy link
Contributor

@qqwqqw689 qqwqqw689 commented Jul 31, 2023

@bedevere-bot bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels Jul 31, 2023
@qqwqqw689
Copy link
Contributor Author

qqwqqw689 commented Jul 31, 2023

issue : #107453

@AlexWaygood AlexWaygood changed the title Add some missing errnos gh-107453: document some undocumented errnos Jul 31, 2023
@AA-Turner AA-Turner changed the title gh-107453: document some undocumented errnos gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} Jul 31, 2023
@AA-Turner AA-Turner added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jul 31, 2023
@AA-Turner
Copy link
Member

I wonder about sorting -- this PR adds the new constants to the end, but there does seem to be rough numerical order currently (see print('\n'.join(t[1] for t in sorted(errno.errorcode.items())))).

A

@qqwqqw689
Copy link
Contributor Author

@AA-Turner I think sorting is dispensable because we can use "Ctrl+f" .😉

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the constants in order. Then people can either ctrl+F, or see things where they expect when they don't.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@AA-Turner
Copy link
Member

@hugovk -- mea culpa! I should have looked at linux's ordering before leaving a comment, it transpires only one constant was out-of-order (ENOTSUP, which is seemingly duplicates EOPNOTSUPP (see errno(3)). As it was trivial, I've pushed a commit to fix, and reverted another inadvertent commit on the branch.

A

@qqwqqw689
Copy link
Contributor Author

qqwqqw689 commented Aug 24, 2023

I found

#define ENOTSUPP	524	/* Operation is not supported */ 

in linux/include/linux/errno.h

But it seems that linux doesn't define ENOTSUP.

Also this code's output

import errno
import os

print(errno.ENOTSUP)

os.strerror(errno.ENOTSUP)

is

95

in linux.

and is

129
'not supported'

in windows.

Errno constants in windows(https://learn.microsoft.com/en-us/cpp/c-runtime-library/errno-constants?view=msvc-170)

@AA-Turner
Copy link
Member

But it seems that linux doesn't define ENOTSUP.

From the man page linked:

EOPNOTSUPP
Operation not supported on socket (POSIX.1-2001).
(ENOTSUP and EOPNOTSUPP have the same value on Linux, but according to POSIX.1 these error values should be distinct.)

A

@qqwqqw689
Copy link
Contributor Author

Yes, I found it from https://lists.gnu.org/archive/html/bug-glibc/2002-08/msg00017.html

    [ENOTSUP] "Not supported".  A function returns this error when
    certain parameter values are valid, but the functionality they request
    is not available. This can mean that the function does not implement
    a particular command or option value or flag bit at all.  For functions
    that operate on some object given in a parameter, such as a file
    descriptor or a port, it might instead mean that only that specific
    object (file descriptor, port, etc.) is unable to support the other
    parameters given; different file descriptors might support different
    ranges of parameter values.

    If the entire function is not available at all in the implementation,
    it returns ENOSYS instead.

    [EOPNOTSUPP] "Operation not supported". The operation you requested is
    not supported.  Some socket functions don't make sense for all types of
    sockets, and others may not be implemented for all communications
    protocols.  In the GNU system, this error can happen for many calls when
    the object does not support the particular operation; it is a generic
    indication that the server knows nothing to do for that call.

@hugovk hugovk enabled auto-merge (squash) August 27, 2023 05:19
@hugovk hugovk merged commit 1ac6423 into python:main Aug 27, 2023
@miss-islington
Copy link
Contributor

Thanks @qqwqqw689 for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@bedevere-bot

This comment was marked as off-topic.

@bedevere-bot bedevere-bot requested a review from hugovk August 27, 2023 05:19
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 27, 2023
…,ENOTSUP} (pythonGH-107486)

(cherry picked from commit 1ac6423)

Co-authored-by: qqwqqw689 <114795525+qqwqqw689@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-bot
Copy link

GH-108529 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Aug 27, 2023
@bedevere-bot
Copy link

GH-108530 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Aug 27, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 27, 2023
…,ENOTSUP} (pythonGH-107486)

(cherry picked from commit 1ac6423)

Co-authored-by: qqwqqw689 <114795525+qqwqqw689@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
hugovk pushed a commit that referenced this pull request Aug 27, 2023
…E,ENOTSUP} (GH-107486) (#108530)

Co-authored-by: qqwqqw689 <114795525+qqwqqw689@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Yhg1s pushed a commit that referenced this pull request Aug 27, 2023
…E,ENOTSUP} (GH-107486) (#108529)

gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} (GH-107486)
(cherry picked from commit 1ac6423)

Co-authored-by: qqwqqw689 <114795525+qqwqqw689@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy