Serhiy Storchaka
ef1585eb9a
Issue #25923 : Added more const qualifiers to signatures of static and private functions.
11 years ago
Martin Panter
afdd51343c
Issue #25764 : Preserve subprocess fork exception when preexec_fn used
Also fix handling of failure to release the import lock.
11 years ago
Gregory P. Smith
d0a5b1c343
Fixes #23564 : Fix a partially broken sanity check in the _posixsubprocess
internals regarding how fds_to_pass were passed to the child. The bug
had no actual impact as subprocess.py already avoided it.
11 years ago
Victor Stinner
bc5b80bac1
Close #24784 : Fix compilation without thread support
Add "#ifdef WITH_THREAD" around cals to:
* PyGILState_Check()
* _PyImport_AcquireLock()
* _PyImport_ReleaseLock()
11 years ago
Victor Stinner
92f0113701
Close #24784 : Fix compilation without thread support
Add "#ifdef WITH_THREAD" around cals to:
* PyGILState_Check()
* _PyImport_AcquireLock()
* _PyImport_ReleaseLock()
11 years ago
Gregory P. Smith
f9681776c9
Fix computation of max_fd on OpenBSD. Issue #23852 .
11 years ago
Gregory P. Smith
4dff6f6fa6
Issue9951: update _hashopenssl and md5module to use _Py_strhex().
Also update _posixsubprocess to use Py_hexdigits instead of its own constant.
11 years ago
Victor Stinner
e7c749238e
Issue #23851 : close() must not be retried when it fails with EINTR
See the PEP 475 for the rationale.
11 years ago
Victor Stinner
185fd33a17
Issue #23836 : Use _Py_write_noraise() to retry on EINTR in child_exec() of
_posixsubprocess
11 years ago
Victor Stinner
160e819a1d
Issue #23694 : Fix usage of _Py_open() in the _posixsubprocess module
Don't call _Py_open() from _close_open_fds_safe() because it is call just after
fork(). It's not good to play with locks (the GIL) between fork() and exec().
Use instead _Py_open_noraise() which doesn't touch to the GIL.
11 years ago
Victor Stinner
a555cfcb73
Issue #23694 : Enhance _Py_open(), it now raises exceptions
* _Py_open() now raises exceptions on error. If open() fails, it raises an
OSError with the filename.
* _Py_open() now releases the GIL while calling open()
* Add _Py_open_noraise() when _Py_open() cannot be used because the GIL is not
held
11 years ago
Victor Stinner
8f437aac06
Issue #22290 : Fix error handling in the _posixsubprocess module.
* Don't call the garbage collector with an exception set: it causes an
assertion to fail in debug mode.
* Enhance also error handling if allocating an array for the executable list
failed.
* Add an unit test for 4 different errors in the _posixsubprocess module.
12 years ago
Gregory P. Smith
a26987a0a5
Fix the comment to not refer to the removed end_fd parameter.
12 years ago
Gregory P. Smith
d4dcb70287
Don't restrict ourselves to a "max" fd when closing fds before exec()
when we have a way to get an actual list of all open fds from the OS.
Fixes issue #21618 : The subprocess module would ignore fds that were
inherited by the calling process and already higher than POSIX resource
limits would otherwise allow. On systems with a functioning /proc/self/fd
or /dev/fd interface the max is now ignored and all fds are closed.
12 years ago
Gregory P. Smith
efeb9da4ae
Add conditional code for android's lack of definition of SYS_getdent64.
Fixes issue20307. No Misc/NEWS entry because frankly this is an
esoteric platform for anyone to be figuring out how to cross compile
CPython for.
12 years ago
Gregory P. Smith
708a3182c9
Fixes issue #15798 : subprocess.Popen() no longer fails if file
descriptor 0, 1 or 2 is closed.
The errpipe_write fd will always be >= 3.
13 years ago
Gregory P. Smith
361e30c17a
Undo supposed fix for Issue #15798 until I understand why this is
causing test_multiprocessing_forkserver and test_multiprocessing_spawn
failures on head (3.4).
13 years ago
Gregory P. Smith
1eda9e7c30
Fixes Issue #15798 - subprocess.Popen() no longer fails if file
descriptor 0, 1 or 2 is closed.
13 years ago
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.
14 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.
14 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
15 years ago
Gregory P. Smith
4842efcf97
Fix FreeBSD, NetBSD and OpenBSD behavior of the issue #8052 fix.
15 years ago
Gregory P. Smith
e9b7cab1da
Another issue #8052 bugfix (related to previous commit).
"oops" while rearranging the #defines.
15 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.
15 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.
15 years ago
Gregory P. Smith
12fdca59bb
Avoid the compiler warning about the unused return value.
15 years ago
Ross Lagerwall
667d75d059
Don't redefine _GNU_SOURCE if it's already defined.
15 years ago
Ross Lagerwall
031bf95d32
Issue #11006 : Don't issue low level warning in subprocess when pipe2() fails.
15 years ago
Martin v. Löwis
bd928fef42
Rename _Py_identifier to _Py_IDENTIFIER.
15 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.
15 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.
16 years ago
Gregory P. Smith
abcfcba61c
issue10802: fallback to pipe+fcntl when the pipe2 syscall fails with errno ENOSYS.
16 years ago
Gregory P. Smith
14affb84ca
fix a compiler warning about err_msg potentially being used uninitialized.
16 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.
16 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.
16 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.
16 years ago