[New-bugs-announce] [issue7108] test_commands.py failing on OS X 10.5.7 due to '@' in ls output

Meador Inge report at bugs.python.org
Mon Oct 12 01:33:35 CEST 2009


New submission from Meador Inge <meadori at gmail.com>:

I am testing this out of the trunk on OS X 10.5.7:

uclid:trunk minge$ uname -a
Darwin euclid.local 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31
22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386
euclid:trunk minge$ ./python.exe Lib/test/test_commands.py
test_getoutput (__main__.CommandTests) ... ok
test_getstatus (__main__.CommandTests) ... FAIL

======================================================================
FAIL: test_getstatus (__main__.CommandTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_commands.py", line 60, in test_getstatus
    self.assertTrue(re.match(pat, getstatus("/."), re.VERBOSE))
AssertionError: None is not True

----------------------------------------------------------------------
Ran 2 tests in 0.047s

FAILED (failures=1)
Traceback (most recent call last):
  File "Lib/test/test_commands.py", line 69, in <module>
    test_main()
  File "Lib/test/test_commands.py", line 64, in test_main
    run_unittest(CommandTests)
  File
"/Users/minge/Research/Languages/python/trunk/Lib/test/test_support.py",
line 884, in run_unittest
    _run_suite(suite)
  File
"/Users/minge/Research/Languages/python/trunk/Lib/test/test_support.py",
line 867, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_commands.py", line 60, in test_getstatus
    self.assertTrue(re.match(pat, getstatus("/."), re.VERBOSE))
AssertionError: None is not True

[30608 refs]
euclid:trunk minge$ patch -p0 < test_commands.patch 
patching file Lib/test/test_commands.py
euclid:trunk minge$ ./python.exe Lib/test/test_commands.py
test_getoutput (__main__.CommandTests) ... ok
test_getstatus (__main__.CommandTests) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.040s

OK
[30459 refs]

According to the OS X documentation for ls(1) [1] the output of ls can
include the '@' character to denote that file has "extended attributes".
 The attached patch adjust the regex which is applied to the output of
ls to account for this fact (a more rigorous approach would have
conditioned the '@' check on OS X, but I wasn't sure if it was worth the
added complexity).  

[1]
http://developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man1/ls.1.html

----------
components: Tests
files: test_commands.patch
keywords: patch
messages: 93881
nosy: minge
severity: normal
status: open
title: test_commands.py failing on OS X 10.5.7 due to '@' in ls output
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file15106/test_commands.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7108>
_______________________________________


More information about the New-bugs-announce mailing list