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
There is a constant definition error in errno.py #78324
Comments
In errno.py, the constant EDEADLK has a defined value of 11, and the constant EAGAIN has a defined value of 35, which is exactly the opposite of the linux constant definition. See: https://www.thegeekstuff.com/2010/10/linux -error-codes/. |
Can you please add some info on how the errorcode dictionary is generated as shown in the picture along with your OS, system information? They seem to have the right values as per the Linux error codes in my Ubuntu box. I might be wrong on the OS on which this happens since you have mentioned it's the opposite of Linux. cpython git:(master) ✗ rlwrap ./python
Python 3.8.0a0 (heads/master:35c0809, Jul 16 2018, 10:29:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import errno
>>> errno.EDEADLK
35
>>> errno.EAGAIN
11
➜ cpython git:(master) ✗ rlwrap python2.7
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import errno
>>> errno.EDEADLK
35
>>> errno.EAGAIN
11 Machine details and values in header files as below ➜ cpython git:(master) ✗ rg 'EDEADLK|EAGAIN' /usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h /usr/include/asm-generic/errno.h ➜ cpython git:(master) ✗ uname -a Thanks |
Please ignore about how it's generated. I tried ➜ cpython git:(master) ✗ rlwrap ./python
Python 3.8.0a0 (heads/master:35c0809, Jul 16 2018, 10:29:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.strerror(35)
'Resource deadlock avoided'
>>> os.strerror(11)
'Resource temporarily unavailable' Thanks |
The picture is a screenshot from the IDEA editor on my OSX system. This may be just a problem with the python I am using. So sad.
Python 2.7.10 (default, Oct 6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import errno
>>> errno.EDEADLK
11
>>> errno.EAGAIN
35
>>> import os
>>> os.strerror(11)
'Resource deadlock avoided'
>>> os.strerror(35)
'Resource temporarily unavailable'
>>> Any more, follow your shell commands, I found this: ➜ ~ grep -E 'EDEADLK|EAGAIN' /usr/include/sys/errno.h
#define EDEADLK 11 /* Resource deadlock avoided */
/* 11 was EAGAIN */
#define EAGAIN 35 /* Resource temporarily unavailable */
#define EWOULDBLOCK EAGAIN /* Operation would block */
And my OS info:
➜ ~ uname -a
Darwin lktokendeMacBook-Air.local 17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64 Thank you very much. |
I’m not sure if I understand correctly. Is your report about the difference in the values of EAGAIN between Linux and macOS? If so, that is not a bug: the relevant standards only document the name and type of these constants and not their values. The value can and does vary across operating systems. -- Op 19 jul. 2018 om 08:16 heeft lktoken <report@bugs.python.org> het volgende geschreven:
|
yes, I agree that this is not a bug. |
Thanks for the details @lktoken. I assumed that you were on Linux and had the opposite values. Verified it on my Mac and they report the same values as yours. I think the values are also different for Windows machines as @ronaldoussoren noted in his comment EAGAIN - 11 Ref : https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr Thanks |
This is not a bug and the issue can be closed. I’ll do so when I get back to my computer in a couple of days. -- Op 19 jul. 2018 om 08:52 heeft Karthikeyan Singaravelan <report@bugs.python.org> het volgende geschreven:
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: