[issue34143] There is a constant definition error in errno.py

2018-07-18 Thread lktoken


New submission from lktoken :

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/.

--
components: Library (Lib), macOS
files: pythonbug.png
messages: 321863
nosy: lktoken, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: There is a constant definition error in errno.py
type: behavior
versions: Python 2.7
Added file: https://bugs.python.org/file47703/pythonbug.png

___
Python tracker 
<https://bugs.python.org/issue34143>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34143] There is a constant definition error in errno.py

2018-07-19 Thread lktoken

lktoken  added the comment:

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.

--

___
Python tracker 
<https://bugs.python.org/issue34143>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34143] There is a constant definition error in errno.py

2018-07-19 Thread lktoken


lktoken  added the comment:

yes, I agree that this is not a bug. 
I used to think that this value is the same in macOS and Linux. Now it seems 
that I am wrong. And sorry for disturbing you.

--

___
Python tracker 
<https://bugs.python.org/issue34143>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com