diff -r 1cdaa54040dd -r 9c735c7bc6db Lib/test/test_io.py --- a/Lib/test/test_io.py Thu Aug 04 19:59:10 2016 +0200 +++ b/Lib/test/test_io.py Thu Aug 04 12:13:47 2016 -0500 @@ -557,24 +557,6 @@ with self.open(support.TESTFN, "w+b") as f: self.large_file_ops(f) - def test_large_writes(self): - support.requires('largefile', - 'test requires %s bytes and a long time to run' % self.LARGE) - with self.open(support.TESTFN, "wb") as f: - b = bytearray(self.LARGE) - self.assertEqual(f.write(b), self.LARGE) - - def test_large_reads(self): - support.requires('largefile', - 'test requires %s bytes and a long time to run' % self.LARGE) - with self.open(support.TESTFN, "wb") as f: - b = bytearray(self.LARGE) - self.assertEqual(f.write(b), self.LARGE) - - with self.open(support.TESTFN, "rb") as f: - self.assertEqual(f.read(self.LARGE), self.LARGE) - - def test_with_open(self): for bufsize in (0, 1, 100): f = None diff -r 1cdaa54040dd -r 9c735c7bc6db Python/fileutils.c --- a/Python/fileutils.c Thu Aug 04 19:59:10 2016 +0200 +++ b/Python/fileutils.c Thu Aug 04 12:13:47 2016 -0500 @@ -1187,13 +1187,6 @@ /* On Windows, the count parameter of read() is an int */ count = INT_MAX; } -#elif defined(__APPLE__) - if (count > INT_MAX) { - /* Issue #24658: On OSX read(2) will fail when reading more than INT_MAX - * bytes. - */ - count = INT_MAX; - } #else if (count > PY_SSIZE_T_MAX) { /* if count is greater than PY_SSIZE_T_MAX, @@ -1263,12 +1256,6 @@ } else if (count > INT_MAX) count = INT_MAX; -#elif defined(__APPLE__) - if (count > INT_MAX) { - /* Issue #24658: On OSX write(2) will fail when writing more than - INT_MAX bytes. */ - count = INT_MAX; - } #else if (count > PY_SSIZE_T_MAX) { /* write() should truncate count to PY_SSIZE_T_MAX, but it's safer