[issue16743] mmap accepts files > 1 GB, but processes only 1 GB

Richard Oudkerk report at bugs.python.org
Wed Dec 26 15:11:54 CET 2012


Richard Oudkerk added the comment:

On 32 bit Unix mmap() will raise ValueError("mmap length is too large") in Marc's example.  This is correct since Python's sequence protocol does not support indexes larger than sys.maxsize.

But on 32 bit Windows, if length == 0 then the size check always passes, and the actual size mapped is the file size modulo 4GB.

Fix for 3.x is attached with tests.

----------
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file28444/mmap.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16743>
_______________________________________


More information about the Python-bugs-list mailing list