hg-1.4 test, solaris: 5 errors

rupert.thurner rupert.thurner at gmail.com
Sun Nov 8 13:00:01 CST 2009


On 8 Nov., 19:37, "rupert.thurner" <rupert.thur... at gmail.com> wrote:
> On 8 Nov., 19:01, Benoit Boissinot <benoit.boissi... at ens-lyon.org>
> wrote:
>
>
>
> > On Sun, Nov 08, 2009 at 09:58:01AM -0800, rupert.thurner wrote:
> > > On 8 Nov., 18:47, "rupert.thurner" <rupert.thur... at gmail.com> wrote:
> > > > On 8 Nov., 18:32, Benoit Boissinot <benoit.boissi... at ens-lyon.org>
> > > > wrote:
>
> > > > > For bisect, can you give us the return code when trying to execute a
> > > > > program that does not exist? (hg expects 127)
>
> > > > this is the shell as well:
>
> > > > rupert at build10s:~/hg-stable-10s
> > > > $ asdf
> > > > -bash: asdf: command not found
>
> > > > rupert at build10s:~/hg-stable-10s
> > > > $ echo $?
> > > > 127
>
> > > > rupert at build10s:~/hg-stable-10s
> > > > $ sh
> > > > $ asdf
> > > > asdf: not found
> > > > $ echo $?
> > > > 1
> > > > $
>
> > > you think a change from /bin/sh to /bin/bash in all tests would be
> > > acceptable to avoid such errors for once and forever?
>
> > It probably won't fix this particular error anyway (hg is calling
> > util.system() to invoke the command), so no.
>
> of course you are right, sorry for confusion. but subprocess contains
> "shell=True". andhttp://docs.python.org/library/subprocess.htmlsays
> this would mean /bin/sh as default shell. this then means bourne shell
> on solaris with return code 1, and bash on linux with return code 127.
>
> rupert at build10s:~/hg-stable-10s/tests
> $ python
> Python 2.6.2 (r262:71600, May 27 2009, 13:06:14) [C] on sunos5
> Type "help", "copyright", "credits" or "license" for more information.>>> import os
> >>> os.system('asdf')
>
> sh: asdf: not found
> 256>>> import subprocess
> >>> subprocess.call('asdf',shell=True)
>
> /bin/sh: asdf: not found
> 1
>

i am confused by this. even the exit code of os.system differs.

$ python
Python 2.6.4 (r264:75706, Oct 29 2009, 15:38:25)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system('asdf')
sh: asdf: not found
32512
>>> import subprocess
>>> subprocess.call('asdf',shell=True)
/bin/sh: asdf: not found
127

would http://docs.python.org/library/errno.html#module-errno be
something portable, or not?



More information about the Mercurial-devel mailing list