diff -ur ./Lib/os.py /Lib/os.py --- ./Lib/os.py 2009-09-26 13:48:46.000000000 -0700 +++ /Lib/os.py 2012-02-21 14:47:26.000000000 -0700 @@ -58,6 +58,10 @@ ['Windows'], [['cmd.exe', '/c'], ['command.com', '/c']] ], + ibmi=[ + ['OS/400'], + [['/QOpenSys/usr/bin/sh', '-c']] + ], posix=[ [], # posix is a fallback, instead of matching names [['/bin/sh', '-c']] diff -ur ./Lib/subprocess.py /Lib/subprocess.py --- ./Lib/subprocess.py 2012-02-21 13:06:16.000000000 -0700 +++ /Lib/subprocess.py 2012-02-21 14:47:08.000000000 -0700 @@ -1243,8 +1243,10 @@ args[0] = executable builder = java.lang.ProcessBuilder(args) - # os.environ may be inherited for compatibility with CPython - self._setup_env(dict(os.environ if env is None else env), + ostype = os.get_os_type () + if ostype != 'ibmi' or env is not None: + # os.environ may be inherited for compatibility with CPython + self._setup_env(dict(os.environ if env is None else env), builder.environment()) if cwd is None: