Skip to content

Commit

Permalink
merge 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Oct 6, 2016
2 parents 86496f4 + 2bdadeb commit 675a632
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 112 deletions.
14 changes: 14 additions & 0 deletions Lib/test/test_mmap.py
Expand Up @@ -720,6 +720,20 @@ def test_write_returning_the_number_of_bytes_written(self):
self.assertEqual(mm.write(b"yz"), 2)
self.assertEqual(mm.write(b"python"), 6)

@unittest.skipIf(os.name == 'nt', 'cannot resize anonymous mmaps on Windows')
def test_resize_past_pos(self):
m = mmap.mmap(-1, 8192)
self.addCleanup(m.close)
m.read(5000)
try:
m.resize(4096)
except SystemError:
self.skipTest("resizing not supported")
self.assertEqual(m.read(14), b'')
self.assertRaises(ValueError, m.read_byte)
self.assertRaises(ValueError, m.write_byte, 42)
self.assertRaises(ValueError, m.write, b'abc')


class LargeMmapTests(unittest.TestCase):

Expand Down
3 changes: 3 additions & 0 deletions Misc/NEWS
Expand Up @@ -404,6 +404,9 @@ Library
pickling and text representation purposes. Patch by Emanuel Barry and
Serhiy Storchaka.

- Fix possible integer overflows and crashes in the mmap module with unusual
usage patterns.

- Issue #1703178: Fix the ability to pass the --link-objects option to the
distutils build_ext command.

Expand Down

0 comments on commit 675a632

Please sign in to comment.