(self, size)
| 326 | "needs INT_MAX < PY_SSIZE_T_MAX") |
| 327 | @support.bigmemtest(size=INT_MAX + 10, memuse=1, dry_run=False) |
| 328 | def test_large_read(self, size): |
| 329 | self.addCleanup(os_helper.unlink, os_helper.TESTFN) |
| 330 | create_file(os_helper.TESTFN, b'test') |
| 331 | |
| 332 | # Issue #21932: Make sure that os.read() does not raise an |
| 333 | # OverflowError for size larger than INT_MAX |
| 334 | with open(os_helper.TESTFN, "rb") as fp: |
| 335 | data = os.read(fp.fileno(), size) |
| 336 | |
| 337 | # The test does not try to read more than 2 GiB at once because the |
| 338 | # operating system is free to return less bytes than requested. |
| 339 | self.assertEqual(data, b'test') |
| 340 | |
| 341 | |
| 342 | @support.cpython_only |
nothing calls this directly
no test coverage detected