| 2531 | self.assertEqual(p.stdout.read().strip(b" \t\r\n\f"), b"apple") |
| 2532 | |
| 2533 | def test_call_string(self): |
| 2534 | # call() function with string argument on UNIX |
| 2535 | fd, fname = tempfile.mkstemp() |
| 2536 | # reopen in text mode |
| 2537 | with open(fd, "w", errors="surrogateescape") as fobj: |
| 2538 | fobj.write("#!%s\n" % support.unix_shell) |
| 2539 | fobj.write("exec '%s' -c 'import sys; sys.exit(47)'\n" % |
| 2540 | sys.executable) |
| 2541 | os.chmod(fname, 0o700) |
| 2542 | rc = subprocess.call(fname) |
| 2543 | os.remove(fname) |
| 2544 | self.assertEqual(rc, 47) |
| 2545 | |
| 2546 | def test_specific_shell(self): |
| 2547 | # Issue #9265: Incorrect name passed as arg[0]. |