summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
Commit message (Collapse)AuthorAgeFilesLines
* refactor the warning test.Gregory P. Smith2010-12-041-23/+11
|
* issue7213 + issue2320: Cause a DeprecationWarning if the close_fds argument isGregory P. Smith2010-12-041-1/+31
| | | | | | | | | | | | not passed to subprocess.Popen as the default value will be changing in a future Python to the safer and more often desired value of True. DeprecationWarnings that show up in a lot of existing code are controversial and have caused pain in the past. I'd like to leave this on for 3.2 beta1 and see how things go. We can remove the warning if it is deemed too noisy during any betas. (case study: the md5 and sha module DeprecationWarnings are loathed around the world as those modules were never going to be removed in 2.x and 2to3 has a fixer for code that uses them)
* Fix #10554. Added context manager support to Popen objects.Brian Curtin2010-12-031-1/+43
| | | | | | Added a few common Popen uses to the tests like we've done for a few other instances of adding context managers. Eventually the entire test suite could be converted to use the context manager format.
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-6/+6
|
* add filename to ENOENT message #4925Benjamin Peterson2010-11-201-0/+1
|
* Fix a number of ResourceWarnings on Windows due to open pipes.Brian Curtin2010-11-051-0/+17
|
* Add cleanups to stdout/stderr pipes to remove ResourceWarnings.Brian Curtin2010-11-051-0/+16
|
* close some more filesBenjamin Peterson2010-10-311-0/+7
|
* test_subprocess: use surrogateescape error handler to write shell scriptsVictor Stinner2010-10-161-2/+2
| | | | | | test_args_string() and test_call_string() create shell scripts including the path to the Python executable: use surrogateescape to encode paths including surrogate characters.
* test_subprocess doesn't need to C locale to test os.environbVictor Stinner2010-10-141-3/+3
| | | | Improve also the comment to explain why C locale is needed to test os.environ.
* test_subprocess: use C locale to get ascii locale encodingVictor Stinner2010-10-141-0/+4
|
* Issue #9992: Remove PYTHONFSENCODING environment variable.Victor Stinner2010-10-131-4/+0
|
* Make _kill_process more robust under Windows too (see issue #8432)Antoine Pitrou2010-09-241-20/+14
|
* Try a more robust implementation of _kill_processAntoine Pitrou2010-09-201-20/+14
|
* Try to fix buildbot failure (#9902)Antoine Pitrou2010-09-201-0/+4
|
* Try to make signal-sending tests in test_subprocess more robust on slow machinesAntoine Pitrou2010-09-191-2/+4
|
* Try to fix test_subprocess on "x86 debian parallel 3.x" buildbotAntoine Pitrou2010-09-191-4/+4
|
* Issue #9895: speed up test_subprocessAntoine Pitrou2010-09-181-13/+32
|
* Issue #9894: Do not hardcode ENOENT in test_subprocess.Antoine Pitrou2010-09-181-1/+1
| | | | (GNU/Hurd is not dead)
* Fix #9588. Add sys.executable to two shell=True tests.Brian Curtin2010-08-131-2/+3
|
* #2304: fix incorporating Eric Smith's .format suggestion and tested on ↵Tim Golden2010-08-111-1/+43
| | | | Ubuntu as well as Windows
* revert r83830, breaks tests on unixesBenjamin Peterson2010-08-081-42/+0
|
* Issue #2304: Add additional quotes when using cmd shell on Windows. Original ↵Tim Golden2010-08-081-0/+42
| | | | patch from Gabriel Genellina
* Issue #3210: Ensure stdio handles are closed if CreateProcess failsTim Golden2010-08-061-0/+20
|
* Factor out stripping of interpreter debug output in ↵Antoine Pitrou2010-08-041-1/+1
| | | | test.support.strip_python_stderr()
* Workaround for issue 4047: in some configurations ofRonald Oussoren2010-07-231-0/+15
| | | | | | | | | 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.
* Merged revisions 82075 via svnmerge fromJean-Paul Calderone2010-06-181-2/+0
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r82075 | jean-paul.calderone | 2010-06-18 16:00:17 -0400 (Fri, 18 Jun 2010) | 12 lines Revert r60115 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. ........
* Issue #8780: Fix a regression introduced by r78946 in subprocess on WindowsVictor Stinner2010-05-211-0/+11
| | | | | Ensure that stdout / stderr is inherited from the parent if stdout=PIPE / stderr=PIPE is not used.
* Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.Victor Stinner2010-05-181-0/+21
| | | | | | subprocess.Popen() and os._execvpe() support bytes program name. Add os.supports_bytes_environ flag: True if the native OS type of the environment is bytes (eg. False on Windows).
* Issue #8603: Create a bytes version of os.environ for UnixVictor Stinner2010-05-061-5/+3
| | | | | | | Create os.environb mapping and os.getenvb() function, os.unsetenv() encodes str argument to the file system encoding with the surrogateescape error handler (instead of utf8/strict) and accepts bytes, and posix.environ keys and values are bytes.
* Fix test_undecodable_env of test_subproces for non-ASCII directoryVictor Stinner2010-04-231-2/+6
| | | | | | | | | | | | | This test was introduced by r80421 (issue #8391). The fix: copy the environment variables instead of starting Python in an empty environement. In an empty environment, the locale is C and Python uses ASCII for the default file system encoding. The non-ASCII directory will be encoded using surrogates, but Python3 is unable to load a module or package with a filename using surrogates. See issue #8242 for more information about running Python3 with a non-ascii directory in an empty environement.
* Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates andVictor Stinner2010-04-231-1/+23
| | | | bytes strings for environment keys and values
* Issue #8467: Pure Python implementation of subprocess encodes the error messageVictor Stinner2010-04-231-0/+19
| | | | using surrogatepass error handler to support surrogates in the message
* Merged revisions 79344,79346,79350 via svnmerge fromFlorent Xicluna2010-03-271-25/+16
| | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79344 | florent.xicluna | 2010-03-23 15:36:45 +0100 (mar, 23 mar 2010) | 2 lines Silence test_subprocess. ........ r79346 | florent.xicluna | 2010-03-23 16:05:30 +0100 (mar, 23 mar 2010) | 2 lines The standard error should be empty when the signal is killed, except on SIGINT. ........ r79350 | florent.xicluna | 2010-03-23 20:19:16 +0100 (mar, 23 mar 2010) | 2 lines The SIGINT signal may happen earlier, during site.py initialization. ........
* * Fix a refleak when a preexec_fn was supplied (preexec_fn_args_tuple was notGregory P. Smith2010-03-191-0/+42
| | | | | | | | 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.
* * Replaces the internals of the subprocess module from fork through exec onGregory P. Smith2010-03-141-6/+79
| | | | | | | | | | | | | | | 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
* Merged revisions 78833 via svnmerge fromFlorent Xicluna2010-03-111-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78833 | florent.xicluna | 2010-03-11 02:50:48 +0100 (jeu, 11 mar 2010) | 2 lines Revert r78830: realpath() should really be applied to sys.executable. ........
* Merged revisions 78830 via svnmerge fromFlorent Xicluna2010-03-111-1/+1
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78830 | florent.xicluna | 2010-03-11 01:56:59 +0100 (jeu, 11 mar 2010) | 3 lines Fix the test_subprocess failure when sys.executable is meaningless: '' or a directory. It does not fix #7774. ........
* Merged revisions 78736,78759,78761,78767,78788-78789 via svnmerge fromFlorent Xicluna2010-03-081-36/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78736 | florent.xicluna | 2010-03-06 20:43:41 +0100 (sam, 06 mar 2010) | 2 lines Skip test_send_signal, test_kill, test_terminate on win32 platforms, for 2.7a4 release. ........ r78759 | florent.xicluna | 2010-03-07 13:21:36 +0100 (dim, 07 mar 2010) | 2 lines #2777: Enable test_send_signal, test_terminate and test_kill on win32 platforms. ........ r78761 | florent.xicluna | 2010-03-07 16:27:39 +0100 (dim, 07 mar 2010) | 4 lines Do not fail if returncode is 0 on send_signal/kill/terminate, for win32 platforms. Do not hide the KeyboardInterrupt on POSIX platforms. ........ r78767 | florent.xicluna | 2010-03-07 18:12:23 +0100 (dim, 07 mar 2010) | 2 lines #2777: Try hard to make Win7 buildbot happy... ........ r78788 | florent.xicluna | 2010-03-08 11:58:12 +0100 (lun, 08 mar 2010) | 2 lines Fix syntax: "rc != None" -> "rc is not None" ........ r78789 | florent.xicluna | 2010-03-08 11:59:33 +0100 (lun, 08 mar 2010) | 2 lines Replace the stderr logging with assertNotEqual(returncode, 0). ........
* Merged revisions 78721 via svnmerge fromFlorent Xicluna2010-03-061-3/+5
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78721 | florent.xicluna | 2010-03-06 10:54:14 +0100 (sam, 06 mar 2010) | 2 lines #2777: Apply same recipe on win32, i.e. do not inherit file handles. ........
* Merged revisions 78704 via svnmerge fromFlorent Xicluna2010-03-061-2/+4
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78704 | florent.xicluna | 2010-03-06 01:16:57 +0100 (sam, 06 mar 2010) | 2 lines #2777: Apply same recipe for test_terminate and test_kill, i.e. close or redirect fds. ........
* Merged revisions 78701 via svnmerge fromFlorent Xicluna2010-03-051-3/+6
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78701 | florent.xicluna | 2010-03-05 20:31:21 +0100 (ven, 05 mar 2010) | 2 lines #2777: Handle fds more carefully to try to fix some x86-Linux failures (namely, neal bot and twisted bot). ........
* Merged revisions 78673 via svnmerge fromFlorent Xicluna2010-03-051-5/+4
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78673 | florent.xicluna | 2010-03-05 02:05:55 +0100 (ven, 05 mar 2010) | 2 lines Let's use assertIsNone / assertIsNotNone. It's hype. ........
* Remove some debug line...Florent Xicluna2010-03-051-1/+0
|
* Merged revisions 78671 via svnmerge fromFlorent Xicluna2010-03-051-2/+14
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78671 | florent.xicluna | 2010-03-05 01:47:40 +0100 (ven, 05 mar 2010) | 3 lines Workaround #3137: Retry SIGINT if it is not received the first time. test_send_signal should not hang anymore on various Linux distributions. ........
* Merged revisions 78661-78662 via svnmerge fromFlorent Xicluna2010-03-041-10/+24
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78661 | florent.xicluna | 2010-03-04 20:40:48 +0100 (jeu, 04 mar 2010) | 2 lines Cleanup. ........ r78662 | florent.xicluna | 2010-03-04 22:31:58 +0100 (jeu, 04 mar 2010) | 2 lines #2777: Enable test_send_signal, test_kill and test_terminate on all platforms. ........ And fix an oversight of changeset 78510.
* Merged revisions 78532 via svnmerge fromGregory P. Smith2010-03-011-0/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78532 | gregory.p.smith | 2010-02-28 18:53:24 -0800 (Sun, 28 Feb 2010) | 2 lines Fix the new test on windows (skip it, its posix only) ........
* Merged revisions 78523 via svnmerge fromGregory P. Smith2010-03-011-1/+21
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78523 | gregory.p.smith | 2010-02-28 16:05:08 -0800 (Sun, 28 Feb 2010) | 3 lines Issue #1068268: The subprocess module now handles EINTR in internal os.waitpid and os.read system calls where appropriate. ........
* Recorded merge of revisions 78508-78509 via svnmerge fromFlorent Xicluna2010-02-271-332/+309
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78508 | florent.xicluna | 2010-02-27 20:20:50 +0100 (sam, 27 fév 2010) | 2 lines Clean test_subprocess: use assertRaises, skipIf, skipUnless helpers and a custom helper assertStderrEqual. ........ r78509 | florent.xicluna | 2010-02-27 22:15:27 +0100 (sam, 27 fév 2010) | 2 lines Fix an oversight in r78508: p.wait() should be compared to 0 ........