This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author narnie
Recipients narnie
Date 2010-07-15.05:20:33
SpamBayes Score 0.0033435267
Marked as misclassified No
Message-id <1279171254.35.0.713274753233.issue9265@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-07-15 05:20:55narniesetrecipients: + narnie
2010-07-15 05:20:54narniesetmessageid: <1279171254.35.0.713274753233.issue9265@psf.upfronthosting.co.za>
2010-07-15 05:20:52narnielinkissue9265 messages
2010-07-15 05:20:51narniecreate