2013/1/11 Ben Leslie firstname.lastname@example.org:
Python is not UNIX, but I think if you are directly using the POSIX interfaces they should work (more or less) the same way the would if you were writing a C program. (Some of us still use Python to prototype things that will later be converted to C!).
I completed the PEP to list advantages and drawbacks of the different alternatives. I moved the PEP to the PEP repository because I now consider it complete enough (for a first draft!):
I see 3 major alternatives:
(a) add cloexec=False argument to some functions
(b) always set close-on-exec flag and add cloexec=True argument to some functions (to be able to disable it)
(c) add cloexec argument to some functions and a sys.setdefaultcloexec() function to change the default value of cloexec (will be False at startup)
If you care about backward compatibility, (a) is the safest option.
If you care about bugs and security, (b) is the best option. For example, (a) does not fix os.urandom().
(c) tries to be a compromise, but has its own drawbacks.