Index: Misc/maintainers.rst =================================================================== --- Misc/maintainers.rst (revision 82921) +++ Misc/maintainers.rst (working copy) @@ -11,6 +11,10 @@ a given module, then questionable changes should go to python-dev, while any other issues can and should be decided by any committer. +Unless a name is followed by a '*', you should never assign an issue to +that person, only make them nosy. Names followed by a '*' may be assigned +issues involving the module or topic for which the name has a '*'. + The Platform and Interest Area tables list broader fields in which various people have expertise. These people can also be contacted for help, opinions, and decisions when issues involve their areas. @@ -88,7 +92,7 @@ distutils tarek doctest tim_one (inactive) dummy_threading brett.cannon -email barry, r.david.murray +email barry, r.david.murray* encodings lemburg errno exceptions Index: Lib/test/test_cmd.py =================================================================== --- Lib/test/test_cmd.py (revision 82921) +++ Lib/test/test_cmd.py (working copy) @@ -8,7 +8,8 @@ import cmd import sys import re -from io import StringIO +import unittest +import io from test import support class samplecmdclass(cmd.Cmd): @@ -168,9 +169,33 @@ def do_exit(self, arg): return True + +class TestAlternateInput(unittest.TestCase): + + class simplecmd(cmd.Cmd): + + def do_print(self, args): + print(args, file=self.stdout) + + def do_EOF(self, args): + return True + + def test_file_with_missing_final_nl(self): + input = io.StringIO("print test\nprint test2") + output = io.StringIO() + cmd = self.simplecmd(stdin=input, stdout=output) + cmd.use_rawinput = False + cmd.cmdloop() + self.assertMultiLineEqual(output.getvalue(), + ("(Cmd) test\n" + "(Cmd) test2\n" + "(Cmd) ")) + + def test_main(verbose=None): from test import test_cmd support.run_doctest(test_cmd, verbose) + support.run_unittest(TestAlternateInput) def test_coverage(coverdir): trace = support.import_module('trace') Index: Lib/test/test_subprocess.py =================================================================== --- Lib/test/test_subprocess.py (revision 82921) +++ Lib/test/test_subprocess.py (working copy) @@ -750,6 +750,25 @@ os.remove(fname) self.assertEqual(rc, 47) + def test_specific_shell(self): + # Issue #9265: Incorrect name passed as arg[0]. + shells = [] + for prefix in ['/bin', '/usr/bin/', '/usr/local/bin']: + for name in ['bash', 'ksh']: + sh = os.path.join(prefix, name) + if os.path.isfile(sh): + shells.append(sh) + if not shells: # Will probably work for any shell but csh. + self.skipTest("bash or ksh required for this test") + sh = '/bin/sh' + if os.path.isfile(sh) and not os.path.islink(sh): + # Test will fail if /bin/sh is a symlink to csh. + shells.append(sh) + for sh in shells: + p = subprocess.Popen("echo $0", executable=sh, shell=True, + stdout=subprocess.PIPE) + self.assertEqual(p.stdout.read().strip(), sh) + def _kill_process(self, method, *args): # Do not inherit file handles from the parent. # It should fix failures on some platforms. Index: Lib/subprocess.py =================================================================== --- Lib/subprocess.py (revision 82921) +++ Lib/subprocess.py (working copy) @@ -1073,6 +1073,8 @@ if shell: args = ["/bin/sh", "-c"] + args + if executable: + args[0] = executable if executable is None: executable = args[0]