Since the last change to posixmodule.c(Revision 2.332)
by Martin,
test_os.py fails on my Linux box.
The reason is that when an os.stat object is accessed
through
obj.attr or obj[index], they do not always represent the
same
type.
Take, for example, st_atime, st_ctime and st_mtime.
With Martin's change, if they're accessed like
stat_obj.st_atime,
it returns a float value.
On the other hand, stat_obj[stat.ST_ATIME] still
remains to return
an integer value.
Here is the result of running test_os.py(abbreviated) ::
test_tempnam (__main__.TemporaryFileTests) ... ok
test_tmpfile (__main__.TemporaryFileTests) ... ok
test_tmpnam (__main__.TemporaryFileTests) ... ok
test_stat_attributes (__main__.StatAttributeTests) ...
FAIL
[snip]
==========================================
============================
FAIL: test_stat_attributes (__main__.StatAttributeTests)
-------------------------------------------------------
---------------
Traceback (most recent call last):
File "./test_os.py", line 115, in test_stat_attributes
result[getattr(stat, name)])
AssertionError: 1106224156.927747 != 1106224156
-------------------------------------------------------
---------------
Ran 23 tests in 0.032s
FAILED (failures=1)
|