test_commands does not work on IRIX
It assumes the output of "ls /bin/ls" is a line
that starts with a '-'. On IRIX that file is
a symbolic link, so the first character is an l.
This causes test_getstatus to fail.
>>> import commands
>>> commands.getstatus("/bin/ls")
'lrwxr-xr-x 1 root sys 13 Feb 23
1997 /bin/ls -> ../../sbin/ls'
>>> pat = r'''-..x..x..x # It is executable.
... \s+\d+ # It has some
number of links.
... \s+\w+\s+\w+ # It has a user and
group, which may
... # be named
anything.
... [^/]* # Skip the date.
... /bin/ls # and end with the
name of the file.
... '''
>>> import re
>>> re.match(pat, commands.getstatus("/bin/ls"),
re.VERBOSE)
>>>
Here's a context diff for a patch. (I hate how narrow
this entry textbox is.) Feel free to adjust the '#'s
so they all line up.
*** Lib/test/test_commands.py 2001/07/23
04:08:01 1.1
--- Lib/test/test_commands.py 2001/08/29 04:18:36
***************
*** 32,38 ****
def test_getstatus(self):
# This pattern should match 'ls -ld /bin/ls'
on any posix
# system, however perversely configured.
! pat = r'''-..x..x..x # It is executable.
\s+\d+ # It has some number
of links.
\s+\w+\s+\w+ # It has a user and
group, which may
# be named
anything.
--- 32,38 ----
def test_getstatus(self):
# This pattern should match 'ls -ld /bin/ls'
on any posix
# system, however perversely configured.
! pat = r'''[l-]..x..x..x # It is
executable. (May be a symlink.)
\s+\d+ # It has some number
of links.
\s+\w+\s+\w+ # It has a user and
group, which may
# be named
anything.
|