Issue 9229: memoryview of mmap object not working in 2.7 (original) (raw)

This code works in 3.1.2 but not in 2.7:

import mmap m = mmap.mmap(-1,20) v = memoryview(m) Traceback (most recent call last): File "", line 1, in TypeError: cannot make memory view because object does not have the buffer interface

True, not all modules in 2.7 have converted to support the new buffer interface (which memoryview() requires, as opposed to the "old" buffer interface used by buffer()). Unfortunately, it's probably too late to care about this now that the 2.7 branch is in bugfix mode.