[3.6] bpo-31106: Fix handling of erros in posix_fallocate() and posix… by larryhastings · Pull Request #3088 · python/cpython
Expand Up
@@ -236,6 +236,16 @@ def test_posix_fallocate(self):
finally:
os.close(fd)
# issue31106 - posix_fallocate() does not set error in errno. @unittest.skipUnless(hasattr(posix, 'posix_fallocate'), "test needs posix.posix_fallocate()") def test_posix_fallocate_errno(self): try: posix.posix_fallocate(-42, 0, 10) except OSError as inst: if inst.errno != errno.EBADF: raise
@unittest.skipUnless(hasattr(posix, 'posix_fadvise'), "test needs posix.posix_fadvise()") def test_posix_fadvise(self): Expand All @@ -245,6 +255,15 @@ def test_posix_fadvise(self): finally: os.close(fd)
@unittest.skipUnless(hasattr(posix, 'posix_fadvise'), "test needs posix.posix_fadvise()") def test_posix_fadvise_errno(self): try: posix.posix_fadvise(-42, 0, 0, posix.POSIX_FADV_WILLNEED) except OSError as inst: if inst.errno != errno.EBADF: raise
@unittest.skipUnless(os.utime in os.supports_fd, "test needs fd support in os.utime") def test_utime_with_fd(self): now = time.time() Expand Down
# issue31106 - posix_fallocate() does not set error in errno. @unittest.skipUnless(hasattr(posix, 'posix_fallocate'), "test needs posix.posix_fallocate()") def test_posix_fallocate_errno(self): try: posix.posix_fallocate(-42, 0, 10) except OSError as inst: if inst.errno != errno.EBADF: raise
@unittest.skipUnless(hasattr(posix, 'posix_fadvise'), "test needs posix.posix_fadvise()") def test_posix_fadvise(self): Expand All @@ -245,6 +255,15 @@ def test_posix_fadvise(self): finally: os.close(fd)
@unittest.skipUnless(hasattr(posix, 'posix_fadvise'), "test needs posix.posix_fadvise()") def test_posix_fadvise_errno(self): try: posix.posix_fadvise(-42, 0, 0, posix.POSIX_FADV_WILLNEED) except OSError as inst: if inst.errno != errno.EBADF: raise
@unittest.skipUnless(os.utime in os.supports_fd, "test needs fd support in os.utime") def test_utime_with_fd(self): now = time.time() Expand Down