Jason Vas Dias <jason.vas.d...@gmail.com> added the comment:

Oops, thought there may be gotchas to that multi-arch python wrapper -
it wasn't quoting its arguments properly - here is now what I have as
/usr/bin/python :

$ cat python
#!/bin/bash
ME=$0
ME=${ME##*/}
VERSION=${ME#python}
VERSION=${VERSION:-2.7}
ARCH=`uname -m`
CMD=''
case $ARCH in
  i686)
     CMD="/usr/bin/32/${ME}"
     ;;
  *)
     CMD="/usr/bin/python${VERSION}.bin"
     ;;
esac
for((a=1;a<=$#;a++));do CMD="${CMD} '"$(eval 'echo -n "$'$a'"')"' ";done
eval "exec $CMD"

I had to move the /usr/bin/python${VERSION} executables to 
/usr/bin/python${VERSION}.bin , and replace them with copies
of this python script (which runs whichever version it is named by).

And I can do:

$ python -c 'import os
import sys
import commands
print commands.getstatus("ls -ld /.")
'
drwxr-xr-x. 25 root root 4096 Apr 20 15:28 /.

under both the native x86_64 and a 'setarch i686' environment with
the same results.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11946>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to