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

2018-07-19 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
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 Ronald Oussoren

Ronald Oussoren  added the comment:

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. 

--
On the road, hence brief. 

Op 19 jul. 2018 om 08:52 heeft Karthikeyan Singaravelan 
 het volgende geschreven:

> 
> Karthikeyan Singaravelan  added the comment:
> 
> 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
> EDEADLK - 36 (Not 35 like Linux)
> 
> Ref : 
> https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr
> 
> Thanks
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
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 Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

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
EDEADLK - 36 (Not 35 like Linux)

Ref : 
https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr

Thanks

--

___
Python tracker 

___
___
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 

___
___
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 Ronald Oussoren

Ronald Oussoren  added the comment:

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.  

--
On the road, hence brief. 

Op 19 jul. 2018 om 08:16 heeft lktoken  het volgende 
geschreven:

> 
> 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
> #defineEDEADLK11/* Resource deadlock avoided */
>/* 11 was EAGAIN */
> #defineEAGAIN35/* Resource temporarily unavailable */
> #defineEWOULDBLOCKEAGAIN/* 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 
> 
> ___

--

___
Python tracker 

___
___
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 

___
___
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-18 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

Please ignore about how it's generated. I tried `errno.errorcode` and can get 
the dictionary as in the picture with 
https://docs.python.org/3.8/library/errno.html#errno.errorcode. I think this 
has to be used as below and also would like to know how other error names have 
the correct numeric value except for the EDEADLK and EAGAIN which is generated 
at Modules/errnomodule.c . Using them with `os.strerror` also gets me the 
correct information 

➜  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

--

___
Python tracker 

___
___
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-18 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

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
14:#define  EAGAIN  11  /* Try again */

/usr/include/asm-generic/errno.h
6:#define   EDEADLK 35  /* Resource deadlock would occur */

➜  cpython git:(master) ✗ uname -a
Linux ubuntu-s-1vcpu-1gb-blr1-01 4.4.0-127-generic #153-Ubuntu SMP Sat May 19 
10:58:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


Thanks

--
nosy: +xtreak

___
Python tracker 

___
___
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-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 

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