summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] bpo-32964: Reuse a testing implementation of the path protocol in ↵Serhiy Storchaka2018-03-031-6/+2
| | | | | | | tests. (GH-5930). (GH-5958) (cherry picked from commit b21d155f57d284aecf9092a9bd24258293965c2f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)Miss Islington (bot)2018-02-191-1/+1
| | | | | (cherry picked from commit 5537646bfacec463b450871dde31cb06c44a0556) Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
* bpo-32667: Fix tests when $PATH contains a file (GH-5322) (#5323)Miss Islington (bot)2018-01-251-8/+7
| | | | | | Some tests failed when the PATH environment variable contained a path to an existing file. Fix tests to ignore also NotADirectoryError, not only FileNotFoundError and PermissionError. (cherry picked from commit b31206a223955d614d7769f95fb979d60f77bf87)
* [3.6] bpo-31178: Mock os.waitpid() in test_subprocess (GH-3896) (#3897)3.6Miss Islington (bot)2017-10-051-4/+8
| | | | | | | Fix test_exception_errpipe_bad_data() and test_exception_errpipe_normal() of test_subprocess: mock os.waitpid() to avoid calling the real os.waitpid(0, 0) which is an unexpected side effect of the test. (cherry picked from commit 11045c9d8a21dd9bd182a3939189db02815f9783)
* [3.6] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in ↵Miss Islington (bot)2017-09-141-0/+9
| | | | | case env has a bad keys() method. (GH-3580) (#3584) (cherry picked from commit 0b3a87ef54a0112b74e8a1d8c6f87d10db4239ab)
* [3.6] bpo-31178: Avoid concatenating bytes with str in subprocess error ↵Gregory P. Smith2017-09-061-0/+47
| | | | | | (GH-3066) (#3388) Avoid concatenating bytes with str in the typically rare subprocess error path (exec failed). Includes a mock based unittest to exercise the codepath. (cherry picked from commit 3fc499bca18454b9f432b9b0106cab662bfeb549)
* bpo-22536 [3.6] Set filename in FileNotFoundError (#3305)Gregory P. Smith2017-09-041-0/+12
| | | | | | | | | | * [3.6] bpo-22536: Set the filename in FileNotFoundError. (GH-3194) Have the subprocess module set the filename in the FileNotFoundError exception raised on POSIX systems when the executable or cwd are missing. (cherry picked from commit 8621bb5d93239316f97281826461b85072ff6db7) * bpo-22536 [3.6] (GH-3202) skip non-windows tests.
* [3.6] bpo-30121: Fix debug assert in subprocess on Windows (#1224) (#3173)Victor Stinner2017-08-211-8/+52
| | | | | | | | | | | | | | | | | | | * bpo-30121: Fix debug assert in subprocess on Windows (#1224) * bpo-30121: Fix debug assert in subprocess on Windows This is caused by closing HANDLEs using os.close which is for CRT file descriptors and not for HANDLEs. * bpo-30121: Suppress debug assertion in test_subprocess when ran directly (cherry picked from commit 4d3851727fb82195e4995c6064b0b2d6cbc031c4) * Add test_subprocess.test_nonexisting_with_pipes() (#3133) bpo-30121: Test the Popen failure when Popen was created with pipes. Create also NONEXISTING_CMD variable in test_subprocess.py. (cherry picked from commit 9a83f651f31b47b3f6c8b210f7807b26e8c373a5)
* bpo-31067: test_subprocess calls reap_children() (#2931) (#3074)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) (#3070)Victor Stinner2017-08-111-35/+22
| | | | | | | | | | | | | | 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-30764: test_subprocess uses SuppressCrashReport (#2405) (#2410)Victor Stinner2017-06-261-26/+25
| | | | | | 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)
* [3.6] bpo-30730: Prevent environment variables injection in subprocess on ↵Serhiy Storchaka2017-06-231-0/+40
| | | | | | Windows. (GH-2325) (#2360) Prevent passing other invalid environment variables and command arguments.. (cherry picked from commit d174d24a5d37d1516b885dc7c82f71ecd5930700)
* [3.6] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). ↵Serhiy Storchaka2017-04-191-1/+12
| | | | | (GH-1110) (#1186) (cherry picked from commit 66bffd1)
* bpo-28624: Add a test that checks that cwd parameter of Popen() accepts ↵Berker Peksag2017-02-261-0/+10
| | | | | PathLike objects (#157) (#323) (cherry picked from commit d5c11f7ace48701bb950c6345deee88c35c66e26)
* Skip the test requiring ctypes if ctypes is unavailable.Gregory P. Smith2017-01-231-1/+6
|\ | | | | | | prevents http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/240/steps/test/logs/stdio
| * Skip the test requiring ctypes if ctypes is unavailable.Gregory P. Smith2017-01-231-1/+6
| | | | | | | | prevents http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/240/steps/test/logs/stdio
* | typo fix, extra '.' on MacOS :)Gregory P. Smith2017-01-231-1/+1
|\ \ | |/
| * typo fix, extra '.' :)Gregory P. Smith2017-01-231-1/+1
| |
* | Issue #29335: Fix subprocess.Popen.wait() when the child process hasGregory P. Smith2017-01-231-0/+41
|\ \ | |/ | | | | exited to a stopped instead of terminated state (ex: when under ptrace).
| * Issue #29335: Fix subprocess.Popen.wait() when the child process hasGregory P. Smith2017-01-231-0/+41
| | | | | | | | exited to a stopped instead of terminated state (ex: when under ptrace).
| * Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
| |
* | Issue #20572: The subprocess.Popen.wait method's undocumented endtimeGregory P. Smith2016-11-211-14/+13
| | | | | | | | | | parameter now raises a DeprecationWarning. It was deprecated in 3.4. It was never documented prior to that.
* | Issue #28662: Catch PermissionError in tests when spawning a non existent ↵Xavier de Gaye2016-11-141-2/+3
| | | | | | | | program
* | Issue #6135: Adds encoding and errors parameters to subprocessSteve Dower2016-09-071-18/+41
| |
* | Adds test.support.PGO and skips tests that are not useful for PGO.Steve Dower2016-09-071-0/+3
| |
* | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
| |
* | Issue #27626: Merge spelling fixes from 3.5Martin Panter2016-07-281-1/+1
|\ \ | |/
| * Issue #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-281-1/+1
| | | | | | | | Based on patch by Ville Skyttä.
* | Issue #27472: Add test.support.unix_shell as the path to the default shell.Xavier de Gaye2016-07-221-2/+2
| |
* | merge from 3.5. (moves the issue26372 tests to the proper class)Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-051-46/+46
|\ \ | |/
| * Move the BrokenPipeError tests to the POSIXProcessTestCase classGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-051-46/+46
| | | | | | | | | | instead of the generic ProcessTestCase class as they are posix specific.
* | issue26372 - use os.devnull instead of /dev/nullGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-041-1/+1
|\ \ | |/
| * issue26372 - use os.devnull instead of /dev/nullGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-041-1/+1
| |
* | merge from 3.5 - Fixes Issue #26373: subprocess.Popen.communicateGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-041-0/+47
|\ \ | |/ | | | | | | now correctly ignores BrokenPipeError when the child process dies before .communicate() is called in more (all?) circumstances.
| * Fixes Issue #26373: subprocess.Popen.communicate now correctly ignoresGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-041-0/+47
| | | | | | | | | | BrokenPipeError when the child process dies before .communicate() is called in more (all?) circumstances.
* | issue27167: make the test not care about the exact signal name in theGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-031-1/+3
| | | | | | | | error message as some numbers map to multiple names.
* | Issue #27167: Clarify the subprocess.CalledProcessError error message textGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-031-0/+19
| | | | | | | | when the child process died due to a signal.
* | subprocess now emits a ResourceWarning warningVictor Stinner2016-05-201-2/+6
| | | | | | | | | | Issue #26741: subprocess.Popen destructor now emits a ResourceWarning warning if the child process is still running.
* | Use "with popen:" in test_subprocessVictor Stinner2016-05-201-58/+55
| | | | | | | | Issue #26741.
* | Issue #22274: Merge stderr=STDOUT fix from 3.5Martin Panter2016-05-131-0/+21
|\ \ | |/
| * Issue #22274: Redirect stderr=STDOUT when stdout not redirected, by Akira LiMartin Panter2016-05-131-0/+21
| |
* | Remove more unused imports in tests.Serhiy Storchaka2016-04-241-1/+0
| |
* | Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-3/+0
| |
* | Issue #26782: Add STARTUPINFO to subprocess.__all__ on WindowsMartin Panter2016-04-161-2/+1
|/
* Issue #26782: Acknowledge the incomplete status of __all__ in 3.5Martin Panter2016-04-161-1/+2
| | | | | Handle is probably meant to be excluded, and STARTUPINFO will be added to __all__ in 3.6.
* Issue #10838: Run test__all__() everywhere, even if poll() is not availableMartin Panter2016-04-161-15/+14
|
* Issue #25764: Skip fork failure test when run as rootMartin Panter2015-12-111-2/+6
|
* Issue #25764: Merge OS X test skipping from 3.4 into 3.5Martin Panter2015-12-051-0/+2
|\
| * Issue #25764: Skip the test on OS XMartin Panter2015-12-051-0/+2
| | | | | | | | | | | | | | The OS X buildbots were failing at the second setrlimit() call with EPERM, as if they were trying to raise the hard limit. The call should be keeping the hard limit the same and raising the soft limit back to its original value, so I don't understand the failure.
* | Issue #25764: Merge subprocess fix from 3.4 into 3.5Martin Panter2015-12-051-0/+16
|\ \ | |/