New submission from Narnie Harshoe <signupli...@gmail.com>: Popen from the subprocess module when called with shell=True and executable=/bin/bash still runs in the /bin/sh shell.
The error has been found and corrected in the subprocess module and is as follows: change: lines 1018-1022 for python v 2.6 lines 1092-1096 for python v 2.7 lines 1046-1050 for python v 3.1 from this: if shell: args = ["/bin/sh", "-c"] + args if executable is None: executable = args[0] to this: if shell: if executable is None: args = ["/bin/sh", "-c"] + args executable = args[0] else: args = [executable, "-c"] + args # if executable is None: # executable = args[0] Of course the last 2 lines can just be deleted but were left in to better highlight the change. This change corrects the bug allowing shell=True and executable=/bin/bash to run in a bash shell or any other shell sub'd for /bin/bash. Hope this will make it into the module. I've included my temp fix which I have simply called subprocess2 for my purposes for v 2.6. ---------- components: Library (Lib) files: subprocess2.py messages: 110346 nosy: narnie priority: normal severity: normal status: open title: Can choose other shell in subprocess module. Includes fix. type: behavior versions: Python 2.6, Python 2.7, Python 3.1 Added file: http://bugs.python.org/file18010/subprocess2.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9265> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com