Bugs item #1105998, was opened at 2005-01-20 15:04 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1105998&group_id=5470
Category: Python Library Group: Python 2.5 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: George Yoshida (quiver) Assigned to: Martin v. Löwis (loewis) Summary: os.stat int/float oddity Initial Comment: 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) ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2005-01-23 10:29 Message: Logged In: YES user_id=21627 Thanks for the report. Fixed in test_os.py 1.28 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1105998&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com