[Python-bugs-list] [ python-Bugs-497160 ] test_commands assumes ls is in /bin

noreply@sourceforge.net noreply@sourceforge.net
Mon, 01 Apr 2002 15:58:00 -0800


Bugs item #497160, was opened at 2001-12-27 16:38
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=497160&group_id=5470

Category: Build
Group: Python 2.2
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Paul Jarc (prjsf)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: test_commands assumes ls is in /bin

Initial Comment:
I got this test failure while building Python 2.2:
test test_commands failed -- Traceback (most recent
call last):
  File "./Lib/test/test_commands.py", line 43, in
test_getstatus
    self.assert_(re.match(pat, getstatus("/bin/ls"),
re.VERBOSE))
  File
"/fs/home/mount/home/prj/b/Python-2.2/Lib/unittest.py",
line 262, in failUnless
    if not expr: raise self.failureException, msg
AssertionError

My ls happens to be somewhere other than /bin.  It would
be nice if the test used a different file, such as "/",
".", or even "./Lib/test/test_commands.py".

----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-04-01 18:58

Message:
Logged In: YES 
user_id=3066

Checked in patch as provided in Lib/test/test_commands.py
revision 1.4; closed bug #460613 as well.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-03-27 15:36

Message:
Logged In: YES 
user_id=6656

No attempt was made to fix this for 2.2.1c2.

I didn't make fixing little bugs in the tests a priority, 
sorry.

I don't think it's been fixed on the trunk.

----------------------------------------------------------------------

Comment By: Paul Jarc (prjsf)
Date: 2002-03-26 16:50

Message:
Logged In: YES 
user_id=412110

This problem still exists in 2.2.1c2.  Is there something wrong
with my patch?

----------------------------------------------------------------------

Comment By: Paul Jarc (prjsf)
Date: 2001-12-31 02:12

Message:
Logged In: YES 
user_id=412110

Sorry, I should have thought of providing a patch to begin
with.
<URL:http://multivac.cwru.edu./prj/python-test-commands.patch>
This regexp test is weaker than the original one, but seems to 
be still stronger than necessary.  If ls is broken here, we
don't care, because it isn't part of Python.  All wee need is
to be able to spawn a shell.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-29 09:55

Message:
Logged In: YES 
user_id=6380

Assigned to Fred Drake, who wrote the test suite.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-29 09:54

Message:
Logged In: YES 
user_id=6380

OK, reopening.

----------------------------------------------------------------------

Comment By: Sjoerd Mullender (sjoerd)
Date: 2001-12-29 06:55

Message:
Logged In: YES 
user_id=43607

This bug report is related to [ #460613 ] test_commands fails on SGI, which nobody ever seems to have noticed 
and which is still open.
The problem there is that /bin/ls *does* exist, but is a symlink.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-28 17:42

Message:
Logged In: YES 
user_id=6380

If the patch is so simple, why don't you provide it?

----------------------------------------------------------------------

Comment By: Paul Jarc (prjsf)
Date: 2001-12-28 17:20

Message:
Logged In: YES 
user_id=412110

The test suite already uses $PATH to *run* ls (as does other
software, which is why I don't get into a lot of trouble).
It merely uses /bin/ls as a filename to pass to ls so it can
check the output.  Any other filename will do just as well
here, and the fix is extremely simple; what's the benefit of
listing /bin/ls in particular that makes it worth risk
breaking on systems like this?

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-28 16:56

Message:
Logged In: YES 
user_id=6380

I think you are going to get in a lot of trouble when
/bin/ls doesn't exist. It's not worth fixing the test suite
for this.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=497160&group_id=5470