summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-31067: test_subprocess calls reap_children() (#2931) (#3073)Victor Stinner2017-08-111-0/+2
| | | | | test_subprocess now also calls reap_children() in tearDown(), not only on setUp(). (cherry picked from commit cc42c121eb5346f673247f95dac575aadb77d66c)
* bpo-31173: Rewrite WSTOPSIG test of test_subprocess (#3055) (#3071)Victor Stinner2017-08-111-33/+26
| | | | | | | | | | | | | | The current test_child_terminated_in_stopped_state() function test creates a child process which calls ptrace(PTRACE_TRACEME, 0, 0) and then crash (SIGSEGV). The problem is that calling os.waitpid() in the parent process is not enough to close the process: the child process remains alive and so the unit test leaks a child process in a strange state. Closing the child process requires non-trivial code, maybe platform specific. Remove the functional test and replaces it with an unit test which mocks os.waitpid() using a new _testcapi.W_STOPCODE() function to test the WIFSTOPPED() path. (cherry picked from commit 7b7c6dcfff6a35333988a3c74c895ed19dff2e09)
* bpo-30705: Fix test_regrtest.test_crashed() (#2439)Victor Stinner2017-06-271-4/+3
| | | | | | | * Add test.support._crash_python() which triggers a crash but uses test.support.SuppressCrashReport() to prevent a crash report from popping up. * Modify test_child_terminated_in_stopped_state() of test_subprocess and test_crashed() of test_regrtest to use _crash_python().
* [2.7] bpo-30764: test_subprocess uses SuppressCrashReport (#2405) (#2412)Victor Stinner2017-06-261-26/+25
| | | | | | | | | | | | | | | * bpo-30764: Backport support.SuppressCrashReport Backport test.support.SuppressCrashReport context-manager from master. Drop the Windows implementation since it depends on msvcrt.CrtSetReportMode() which isn't available on Python 2.7. * bpo-30764: test_subprocess uses SuppressCrashReport (#2405) bpo-30764, bpo-29335: test_child_terminated_in_stopped_state() of test_subprocess now uses support.SuppressCrashReport() to prevent the creation of a core dump on FreeBSD. (cherry picked from commit cdee3f14f7f4c995e7eedb0bf6a67e260c739f7d)
* [2.7] bpo-30730: Prevent environment variables injection in subprocess on ↵Serhiy Storchaka2017-06-241-0/+40
| | | | | | Windows. (GH-2325) (#2372) Prevent passing other invalid environment variables and command arguments.. (cherry picked from commit d174d24a5d37d1516b885dc7c82f71ecd5930700)
* Issue #29335: Fix subprocess.Popen.wait() when the child process hasGregory P. Smith2017-01-231-0/+46
| | | | exited to a stopped instead of terminated state (ex: when under ptrace).
* Correct print() calls to print a blank line in various test casesMartin Panter2016-09-101-1/+1
|
* Issue #22274: Redirect stderr=STDOUT when stdout not redirected, by Akira LiMartin Panter2016-05-131-0/+21
|
* Issue #25249: Remove unneeded mkstemp helper in test_subprocessBerker Peksag2015-09-281-17/+7
| | | | | | | The helper was added in 76641824cf05 11 years ago and it can be removed now since all supported Python versions have tempfile.mkstemp(). Patch by Nir Soffer.
* Issue #18851: Avoid a double close of subprocess pipes when the child ↵Antoine Pitrou2013-08-301-2/+36
| | | | process fails starting.
* Issue #18174: Fix fd leaks in tests.Richard Oudkerk2013-06-101-1/+2
|
* #11963: fix Windows buildbots.Ezio Melotti2013-03-111-4/+4
|
* #11963: remove human verification from test_subprocess.Ezio Melotti2013-03-101-12/+36
|
* Issue #16762: Fix some test_subprocess failures on NetBSD and OpenBSD: kill()Charles-François Natali2013-01-121-0/+2
| | | | returns ESRCH for a zombie process, which is not POSIX-compliant.
* remove an obsolete commentGregory P. Smith2012-11-111-1/+0
|
* Refactor test_preexec_errpipe to not create an uncollectable reference cycle.Gregory P. Smith2012-11-111-22/+22
|
* whitespace fixGregory P. Smith2012-11-111-1/+1
|
* Fix issue #16140 bug that the fix to issue #16327 added - don't doubleGregory P. Smith2012-11-111-0/+47
| | | | | close subprocess.PIPE file descriptors when the child encounters an error prior to exec.
* Fixes issue #16327: The subprocess module no longer leaks file descriptorsGregory P. Smith2012-11-111-0/+33
| | | | used for stdin/stdout/stderr pipes to the child when fork() fails.
* Clean up a test turd.Mark Dickinson2012-10-071-0/+1
|
* Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under ↵Antoine Pitrou2012-03-111-0/+67
| | | | Windows when the child process has already exited.
* you can't get resource.error if you can't import resourceBenjamin Peterson2011-12-101-11/+16
|
* Issue #12786: Set communication pipes used by subprocess.Popen CLOEXEC to avoidCharles-François Natali2011-08-251-0/+31
| | | | them being inherited by other subprocesses.
* Fix resource leaks in test_subprocess.Nadeem Vawda2011-08-191-0/+4
|
* Issue #12650: fix failures on some buildbots, when a subprocess takes a longCharles-François Natali2011-08-181-12/+0
| | | | time to spawn.
* Issue #12650: only run the tests on Unix.Charles-François Natali2011-08-181-58/+58
|
* Issue #12650: Fix a race condition where a subprocess.Popen could leakCharles-François Natali2011-08-181-0/+57
| | | | resources (FD/zombie) when killed at the wrong time.
* Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr isRoss Lagerwall2011-07-271-0/+58
| | | | given as a low fd, it gets overwritten.
* Issue #12493: skip test_communicate_eintr() if signal.SIGALRM is missingVictor Stinner2011-07-051-0/+2
|
* Issue #12493: subprocess: communicate() handles EINTRVictor Stinner2011-07-051-0/+16
| | | | | subprocess.Popen.communicate() now also handles EINTR errors if the process has only one pipe.
* Issue #12085: Fix test_subprocess for my previous commitVictor Stinner2011-05-311-1/+1
| | | | Replace support by test_support, and add captured_stderr() function.
* Close #12085: Fix an attribute error in subprocess.Popen destructor if theVictor Stinner2011-05-311-0/+10
| | | | | constructor has failed, e.g. because of an undeclared keyword argument. Patch written by Oleg Oshmyan.
* Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.Ross Lagerwall2011-04-051-0/+18
|
* #11490: EACCES can also mean command not foundR David Murray2011-03-141-1/+2
|
* Merged revisions 87695 via svnmerge fromAntoine Pitrou2011-01-031-0/+52
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87695 | antoine.pitrou | 2011-01-03 19:23:55 +0100 (lun., 03 janv. 2011) | 5 lines 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. ........
* Merged revisions 87233 via svnmerge fromGregory P. Smith2010-12-141-0/+10
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87233 | gregory.p.smith | 2010-12-14 06:38:00 -0800 (Tue, 14 Dec 2010) | 4 lines Issue #1731717: Fixed the problem where subprocess.wait() could cause an OSError exception when The OS had been told to ignore SIGCLD in our process or otherwise not wait for exiting child processes. ........
* Merged revisions 86207 via svnmerge fromBrian Curtin2010-11-051-0/+17
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86207 | brian.curtin | 2010-11-05 12:09:05 -0500 (Fri, 05 Nov 2010) | 2 lines Fix a number of ResourceWarnings on Windows due to open pipes. ........
* Merged revisions 86185 via svnmerge fromBrian Curtin2010-11-051-0/+16
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86185 | brian.curtin | 2010-11-04 22:58:52 -0500 (Thu, 04 Nov 2010) | 2 lines Add cleanups to stdout/stderr pipes to remove ResourceWarnings. ........
* Merged revisions 84997 via svnmerge fromAntoine Pitrou2010-09-241-20/+14
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84997 | antoine.pitrou | 2010-09-24 20:57:01 +0200 (ven., 24 sept. 2010) | 3 lines Make _kill_process more robust under Windows too (see issue #8432) ........
* Merged revisions 84909-84913 via svnmerge fromAntoine Pitrou2010-09-201-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84909 | antoine.pitrou | 2010-09-20 00:46:05 +0200 (lun., 20 sept. 2010) | 3 lines Try to fix test_subprocess on "x86 debian parallel 3.x" buildbot ........ r84910 | antoine.pitrou | 2010-09-20 01:06:53 +0200 (lun., 20 sept. 2010) | 3 lines Try to make signal-sending tests in test_subprocess more robust on slow machines ........ r84911 | antoine.pitrou | 2010-09-20 01:28:30 +0200 (lun., 20 sept. 2010) | 3 lines Make error more explicit in test_finalize_with_trace ........ r84912 | antoine.pitrou | 2010-09-20 02:12:19 +0200 (lun., 20 sept. 2010) | 3 lines Try to fix buildbot failure (#9902) ........ r84913 | antoine.pitrou | 2010-09-20 03:33:21 +0200 (lun., 20 sept. 2010) | 3 lines Try a more robust implementation of _kill_process ........
* Merged revisions 84883 via svnmerge fromAntoine Pitrou2010-09-181-12/+32
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84883 | antoine.pitrou | 2010-09-19 00:38:48 +0200 (dim., 19 sept. 2010) | 3 lines Issue #9895: speed up test_subprocess ........
* Merged revisions 84878 via svnmerge fromAntoine Pitrou2010-09-181-1/+1
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84878 | antoine.pitrou | 2010-09-18 19:56:02 +0200 (sam., 18 sept. 2010) | 5 lines Issue #9894: Do not hardcode ENOENT in test_subprocess. (GNU/Hurd is not dead) ........
* Merged revisions 83983 via svnmerge fromBrian Curtin2010-08-131-2/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83983 | brian.curtin | 2010-08-13 15:42:57 -0500 (Fri, 13 Aug 2010) | 3 lines Fix #9588. Add sys.executable to two shell=True tests. ........
* #2304: fix incorporating Eric Smith's .format suggestion and tested on ↵Tim Golden2010-08-121-1/+43
| | | | Ubuntu as well as Windows
* revert 83832; unix test breakageBenjamin Peterson2010-08-081-43/+1
|
* Issue #2304: Add additional quotes when using cmd shell on Windows. Original ↵Tim Golden2010-08-081-1/+43
| | | | patch from Gabriel Genellina
* Issue #3210: Ensure stdio handles are closed if CreateProcess failsTim Golden2010-08-061-0/+20
|
* Merged revisions 83067 via svnmerge fromRonald Oussoren2010-07-231-0/+14
| | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83067 | ronald.oussoren | 2010-07-23 10:50:05 +0100 (Fri, 23 Jul 2010) | 8 lines Workaround for issue 4047: in some configurations of the Crash Reporter on OSX test_subprocess will trigger the reporter. This patch prints a warning when the Crash Reporter will get triggered intentionally, which should avoid confusing people. ........
* Issue #9265: Incorrect name passed as arg[0] when shell=TrueStefan Krah2010-07-191-0/+19
| | | | and executable specified.
* Revert r60115Jean-Paul Calderone2010-06-181-2/+0
| | | | | | | | | | | | This revision introduced quoting for strings containing | based on a misunderstanding of the commonly used quoting rules used on Windows. | is interpreted by cmd.exe, not by the MS C runtime argv initializer. It only needs to be quoted if it is part of an argument passed through cmd.exe. See issue1300, issue7839, and issue8972.