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 brian.curtin, eric.araujo, eric.smith, narnie, r.david.murray, skrah
Date 2010-07-18.19:33:46
SpamBayes Score 0.0004221805
Marked as misclassified No
Message-id <1279481629.03.0.0364928898604.issue9265@psf.upfronthosting.co.za>
In-reply-to
Content
Hello,

I am impressed by the activity here. I am a new programmer and cutting my teeth with python. I wish I knew how to do a patch and write unit tests, but I'm just not there yet.

I can show a test case in this fashion where it fails.

First I prove that /bin/sh is /bin/sh (er, dash) and /bin/bash is /bin/bash. Then it can be seen that when executable is set as /bin/bash and there is a shell error, that it returns a shell error from /bin/sh, not from /bin/bash.

I see there are patches here that should fix it, but for those wanting to see the buggy code in action, here it is using the fact that echo was mistyped as echos to raise a shell error (but shell=True so it doesn't raise an OSError exception).
_____________________________

in shell terminal:
$ file /bin/bash
/bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
$ file /bin/sh
/bin/sh: symbolic link to `dash'
$ file /bin/dash
/bin/dash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

in python interactive interpreter

>>> shell = Popen('echos', shell=True, executable="/bin/bash", stdin=PIPE, stderr=PIPE, stdout=PIPE)
>>> shell.communicate()
('', '/bin/sh: echos: command not found\n')
>>> shell = Popen('echos', shell=True, executable="/bin/bash", stdin=PIPE, stderr=PIPE, stdout=PIPE)
>>> shell.communicate()
('', '/bin/bash: echos: command not found\n')

Thank you for working on this so quickly. This is truly an amazing community.
History
Date User Action Args
2010-07-18 19:33:49narniesetrecipients: + narnie, eric.smith, eric.araujo, r.david.murray, brian.curtin, skrah
2010-07-18 19:33:49narniesetmessageid: <1279481629.03.0.0364928898604.issue9265@psf.upfronthosting.co.za>
2010-07-18 19:33:47narnielinkissue9265 messages
2010-07-18 19:33:46narniecreate