Index: Lib/test/test_os.py =================================================================== --- Lib/test/test_os.py (revision 68622) +++ Lib/test/test_os.py (working copy) @@ -570,10 +570,9 @@ if hasattr(os, "fpathconf"): self.assertRaises(OSError, os.fpathconf, 10, "PC_FILESIZEBITS") - #this is a weird one, it raises IOError unlike the others def test_ftruncate(self): if hasattr(os, "ftruncate"): - self.assertRaises(IOError, os.ftruncate, 10, 0) + self.assertRaises(OSError, os.ftruncate, 10, 0) def test_lseek(self): if hasattr(os, "lseek"): Index: Modules/posixmodule.c =================================================================== --- Modules/posixmodule.c (revision 68607) +++ Modules/posixmodule.c (working copy) @@ -6633,7 +6633,7 @@ res = ftruncate(fd, length); Py_END_ALLOW_THREADS if (res < 0) { - PyErr_SetFromErrno(PyExc_IOError); + posix_error(); return NULL; } Py_INCREF(Py_None);