Well, all the other functions raise OSError when the file descriptor is invalid. IOError usually means that the IO itself failed. I wonder if it is platform specific? Does it raise IOError on all platforms? I can also change the test to test for IOError or OSError. K
-----Original Message----- From: Mark Dickinson [mailto:dicki...@gmail.com] Sent: 15. janúar 2009 15:44 To: Kristján Valur Jónsson Cc: Jean-Paul Calderone; python-dev@python.org Subject: Re: [Python-Dev] [Python-checkins] r68547 - in python/trunk/Lib/test: test_datetime.py test_os.py On Thu, Jan 15, 2009 at 9:13 AM, Kristján Valur Jónsson <krist...@ccpgames.com> wrote: > However, these: > > ====================================================================== > ERROR: test_ftruncate (test.test_os.TestInvalidFD) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File > "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_os.py", > line 570, in test_ftruncate > self.assertRaises(OSError, os.ftruncate, 10, 0) > File > "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line > 345, in failUnlessRaises > callableObj(*args, **kwargs) > IOError: [Errno 9] Bad file descriptor At the risk of stating the obvious, shouldn't you be checking for IOError rather than OSError in assertRaises? Mark _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com