[issue2733] mmap resize fails on anonymous memory (Windows)
Hirokazu Yamamoto
report at bugs.python.org
Thu Mar 5 16:27:07 CET 2009
Hirokazu Yamamoto <ocean-city at m2.ccsnet.ne.jp> added the comment:
More two cents which I noticed. (After the patch was applied)
1. On windows, resize for anonymous map can clear its contents.
>>> import mmap
>>> m = mmap.mmap(-1, 10)
>>> m[:] = "0123456789"
>>> m[:]
'0123456789'
>>> m.resize(20)
>>> m[:]
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0'
2. Anonymous map on unix also has similar problem. ftruncate() fails for
fd == -1
Sorry for having clear solution for this. But I cannot say "This is what
mmap.resize should behave!".
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2733>
_______________________________________
More information about the Python-bugs-list
mailing list