Victor Stinner
daf455554b
Issue #18571 : Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
13 years ago
Charles-François Natali
249cdc39fc
Issue #18763 : subprocess: The file descriptors are now closed after calling the
preexec_fn callback, which may open file descriptors.
13 years ago
Gregory P. Smith
255bf5b9ec
Issue #16962 : Use getdents64 instead of the obsolete getdents syscall in
the subprocess module on Linux.
13 years ago
Gregory P. Smith
8d07c264e4
Raise our own SubprocessError rather than a RuntimeError in when dealing with
odd rare errors coming from the subprocess module.
13 years ago
Gregory P. Smith
5591b02a4c
Fixes Issue #16114 : The subprocess module no longer provides a
misleading error message stating that args[0] did not exist when
either the cwd or executable keyword arguments specified a path that
did not exist.
It now keeps track of if the child got as far as preexec and reports it if
not back to the parent via a special "noexec" error message value in
the error pipe so that the cwd can be blamed for a failed chdir
instead of the exec of the executable being blamed instead.
The executable is also always reported accurately when exec fails.
Unittests enhanced to cover these cases.
13 years ago
Ross Lagerwall
f2b34b8b96
Issue 15777: Fix a refleak in _posixsubprocess.
It was exposed by 03c98d05b140 and dbbf3ccf72e8.
14 years ago
Stefan Krah
db579d7b25
Issue #15738 : Fix a missing NULL check in subprocess_fork_exec().
14 years ago
Antoine Pitrou
6f430e4963
Issue #15604 : Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
14 years ago
Gregory P. Smith
58f07a9d6d
Fixes issue #15000 : support the odd x32 abi on posixsubprocess's system call.
14 years ago
Ross Lagerwall
71faefc37e
Issue #14359 : Only use O_CLOEXEC in _posixmodule.c if it is defined.
Based on patch from Hervé Coatanhay.
14 years ago
Ross Lagerwall
5802fdf31f
Issue 14359: Only use O_CLOEXEC in _posixmodule.c if it is defined.
Based on patch from Hervé Coatanhay.
14 years ago
Ross Lagerwall
7f4fdb266a
Use ANSI C prototype instead of K&R style.
14 years ago
Benjamin Peterson
91eef984fd
fix declaration style
14 years ago
Gregory P. Smith
4842efcf97
Fix FreeBSD, NetBSD and OpenBSD behavior of the issue #8052 fix.
14 years ago
Gregory P. Smith
e9b7cab1da
Another issue #8052 bugfix (related to previous commit).
"oops" while rearranging the #defines.
14 years ago
Gregory P. Smith
e3f7848bc5
Bugfix for issue #8052 fix on *BSD variants.
Many lack readdir64, use readdir. Only use readdir64 on solaris where
it is required to work around a solaris bug.
14 years ago
Gregory P. Smith
8facece99a
Fixes issue #8052 : The posix subprocess module's close_fds behavior was
suboptimal by closing all possible file descriptors rather than just
the open ones in the child process before exec().
It now closes only the open fds when it is possible to safely determine what
those are.
14 years ago
Gregory P. Smith
12fdca59bb
Avoid the compiler warning about the unused return value.
14 years ago
Ross Lagerwall
667d75d059
Don't redefine _GNU_SOURCE if it's already defined.
14 years ago
Ross Lagerwall
031bf95d32
Issue #11006 : Don't issue low level warning in subprocess when pipe2() fails.
14 years ago
Martin v. Löwis
bd928fef42
Rename _Py_identifier to _Py_IDENTIFIER.
14 years ago
Martin v. Löwis
afe55bba33
Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
14 years ago
Ross Lagerwall
d98646e430
Issue #12607 : In subprocess, fix issue where if stdin, stdout or stderr is
given as a low fd, it gets overwritten.
15 years ago
Victor Stinner
5572ba7e15
_posixsubprocess.c: don't redefine _GNU_SOURCE if it's already defined
15 years ago
Gregory P. Smith
9c4f44f70a
Fix issue #11432 . if the stdin pipe is the same file descriptor as either stdout or stderr
in the _posixsubprocess C extension module it would unintentionally close the fds and raise
an error.
15 years ago
Gregory P. Smith
8121898ec5
Fix issue #11432 . if the stdin pipe is the same file descriptor as either stdout or stderr
in the _posixsubprocess C extension module it would unintentionally close the fds and raise
an error.
15 years ago
Antoine Pitrou
c9c83ba896
Issue #10806 , issue #9905 : Fix subprocess pipes when some of the standard
file descriptors (0, 1, 2) are closed in the parent process. Initial
patch by Ross Lagerwall.
15 years ago
Gregory P. Smith
abcfcba61c
issue10802: fallback to pipe+fcntl when the pipe2 syscall fails with errno ENOSYS.
15 years ago
Gregory P. Smith
14affb84ca
fix a compiler warning about err_msg potentially being used uninitialized.
15 years ago
Gregory P. Smith
8edd99d085
Issue #6559 : fix the subprocess.Popen pass_fds implementation. Add a unittest.
Issue #7213 : Change the close_fds default on Windows to better match the new
default on POSIX. True when possible (False if stdin/stdout/stderr are
supplied).
Update the documentation to reflect all of the above.
15 years ago
Gregory P. Smith
51ee270876
issue7213: Open the pipes used by subprocesses with the FD_CLOEXEC flag from
the C code, using pipe2() when available. Adds unittests for close_fds and
cloexec behaviors.
15 years ago
Gregory P. Smith
d4cc7bf993
issue6559: Adds a pass_fds parameter to subprocess.Popen that allows the caller
to list exactly which file descriptors should be kept open.
15 years ago
Victor Stinner
dcb2403022
Issue #8485 : PyUnicode_FSConverter() doesn't accept bytearray object anymore,
you have to convert your bytearray filenames to bytes
16 years ago
Victor Stinner
0e59cc3fc3
Issue #8393 : subprocess accepts bytes, bytearray and str with surrogates for
the current working directory.
Remove also a trailing space, and replace tabulation indentation by spaces.
16 years ago
Gregory P. Smith
32ec9da166
* Fix a refleak when a preexec_fn was supplied (preexec_fn_args_tuple was not
being defref'ed).
* Fixes another potential refleak of a reference to the gc
module in the unlikely odd case where gc module isenabled or disable calls
fail.
* Adds a unittest for the above case to verify behavior and lack of leaks.
16 years ago
Gregory P. Smith
68f52178d9
* Fix the refcount leak in _PySequence_BytesToCharpArray from r78946.
* Also fixes a potential extra DECREF of an arg in the error case within
_posixsubprocess.fork_exec() by not reusing the process_args variable.
16 years ago
Gregory P. Smith
fb94c5f1e5
* Replaces the internals of the subprocess module from fork through exec on
POSIX systems with a C extension module. This is required in order for
the subprocess module to be made thread safe.
The pure python implementation is retained so that it can continue to be
used if for some reason the _posixsubprocess extension module is not
available.
The unittest executes tests on both code paths to guarantee compatibility.
* Moves PyLong_FromPid and PyLong_AsPid from posixmodule.c into longobject.h.
Code reviewed by jeffrey.yasskin at http://codereview.appspot.com/223077/show
16 years ago