[issue26343] os.O_CLOEXEC not available on OS X

2016-02-12 Thread STINNER Victor
STINNER Victor added the comment: > FYI Python creates non-inheritable file descriptors by default since Python > 3.4: PEP 446. You didn't reply why you need O_CLOEXEC? -- ___ Python tracker _

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Ned Deily
Ned Deily added the comment: This is only one example of many cases of calls and options that are exposed by the os module but are not available on specific platforms or platform releases. It would be a huge documentation effort to try to identify and keep them all up-to-date. The fourth bul

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Gustavo Goretkin
Gustavo Goretkin added the comment: Can the documentation be updated accordingly? Currently the documentation (roughly) says that this is available. If not separately noted, all functions that claim “Availability: Unix” are supported on Mac OS X, which builds on a Unix core. os.O_EXLOCK

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Ned Deily
Ned Deily added the comment: Ronald is correct. Apple added O_CLOEXEC to OS X in 10.7. For compatibility reasons, the python.org 64-bit installers for OS X currently are built to be compatible with OS X 10.6 on up and do not do runtime checks for OS features only available on newer releases.

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Ronald Oussoren
Ronald Oussoren added the comment: The lack of o_cloexec could be caused by the SDK used to build the binary installer. AFAIK _DARWIN_C_LEVEL is set automatically based on the deployment target. Ronald Sent from my iPad > On 11 feb. 2016, at 23:44, STINNER Victor wrote: > > > STINNER Vic

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread STINNER Victor
STINNER Victor added the comment: What is __DARWIN_C_LEVEL? Are we supposed to define it directly? Or is it defined from other #define in features.h? -- ___ Python tracker ___ _

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread STINNER Victor
STINNER Victor added the comment: FYI Python creates non-inheritable file descriptors by default since Python 3.4: PEP 446. See also the PEP 433 which has more information on OS support, especially: https://www.python.org/dev/peps/pep-0433/#atomic-flags -- nosy: +haypo ___

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Gustavo Goretkin
Gustavo Goretkin added the comment: It looks like cpython will check to see if O_CLOEXEC is #defined. In my system's /usr/include/sys/fcntl.h #if __DARWIN_C_LEVEL >= 200809L #define O_CLOEXEC 0x100 /* implicitly set FD_CLOEXEC */ #endif --

[issue26343] os.O_CLOEXEC not available on OS X

2016-02-11 Thread Gustavo Goretkin
New submission from Gustavo Goretkin: I am on OS X 10.9.5 Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.O_CLOEXEC Traceback (most recent