diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2013-02-13 12:33:53 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2013-02-13 12:33:53 (GMT) |
commit | 76450e6a84fe25db47326ef865ca9ea3968d319f (patch) | |
tree | 5eda20648c8957a1b5c53acfe1d1493c4a036aad /Lib/test/test_mmap.py | |
parent | 082022b68308cc45639b450ce0c55f183a784b67 (diff) | |
parent | 6d40134eba5633e93a4c45d0d2868b9f1a02439a (diff) | |
download | cpython-76450e6a84fe25db47326ef865ca9ea3968d319f.zip cpython-76450e6a84fe25db47326ef865ca9ea3968d319f.tar.gz cpython-76450e6a84fe25db47326ef865ca9ea3968d319f.tar.bz2 |
Merge
Diffstat (limited to 'Lib/test/test_mmap.py')
-rw-r--r-- | Lib/test/test_mmap.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index 3d883a9..505ffba 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -721,6 +721,13 @@ class LargeMmapTests(unittest.TestCase): def test_large_filesize(self): with self._make_test_file(0x17FFFFFFF, b" ") as f: + if sys.maxsize < 0x180000000: + # On 32 bit platforms the file is larger than sys.maxsize so + # mapping the whole file should fail -- Issue #16743 + with self.assertRaises(OverflowError): + mmap.mmap(f.fileno(), 0x180000000, access=mmap.ACCESS_READ) + with self.assertRaises(ValueError): + mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) with mmap.mmap(f.fileno(), 0x10000, access=mmap.ACCESS_READ) as m: self.assertEqual(m.size(), 0x180000000) |