the declaration for pythons mmap.move method uses signed ints which result in an out of range exception on amd64 (and possibly any 64bit platform) Reproducible: Always Steps to Reproduce: from mmap import mmap f = open('test.out', 'ab+') f.write('ABCDEabcde') f.flush() m = mmap(f.fileno(),10) m.move(5,0,5) m.read() Actual Results: after m.move(5,0,5) you get: Traceback (most recent call last): File "<stdin>", line 1, in ? ValueError: source or destination out of range Expected Results: >>> m.read(10) 'ABCDEABCDE'
Created attachment 73481 [details, diff] fix to use longs for mmap move calls Adjusts mmap move to use longs for defining memmory addresses rather than ints. tested on: x86 (Python 2.4.2, GCC 3.4.4-r1) amd64 (Python 2.4.2 GCC 3.3.6) (thanks to mu from quodlibet for the fix)
we should push thise patch upstream as well.
spotted change in python svn: http://svn.python.org/view/python/trunk/Modules/mmapmodule.c?rev=42012&view=auto instead of "iii" they're using "kkk": http://docs.python.org/api/arg-parsing.html
Fixed in 2.4.2-r1.