Index: Lib/test/test_javashell.py =================================================================== --- Lib/test/test_javashell.py (revision 3355) +++ Lib/test/test_javashell.py (working copy) @@ -163,6 +163,18 @@ newValue, value )) + def testFormatUnicodeCommand(self): + shell = javashell._ShellEnv(cmd=['runner']) + self.assertEqual(shell._formatCmd('echo hello'), ['runner', 'echo hello']) + self.assertEqual(shell._formatCmd(u'echo world'), ['runner', u'echo world']) + + def testExecuteUnicodeCommandWithRedirection(self): + process = javashell.shellexecute(u'nonexcmd 2>&1') + stdout = process.getOutputStream().toString() + process.waitFor() + self.assertNotEqual(stdout, "", "Redirecting 2>&1 failed with unicode cmd") + + def test_main(): test_support.run_unittest(JavaShellTest) Index: Lib/javashell.py =================================================================== --- Lib/javashell.py (revision 3355) +++ Lib/javashell.py (working copy) @@ -75,7 +75,7 @@ " setting %s. Failed command=%s""" raise OSError( 0, msgFmt % ( _osType, _envType, cmd )) - if isinstance(cmd, types.StringType): + if isinstance(cmd, types.StringTypes): shellCmd = self.cmd + [cmd] else: shellCmd = cmd