[issue12882] mmap crash on Windows

sbt report at bugs.python.org
Fri Sep 2 13:10:09 CEST 2011


sbt <shibturn at gmail.com> added the comment:

You are not doing anything to stop the file object being garbage collected (and therefore closed) before the mmap is created.  Try

import os
import mmap
f = open(<Certain File>,"r+")
size = os.path.getsize(<Certain File>))
data = mmap.mmap(f.fileno(), size)

----------
nosy: +sbt

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


More information about the Python-bugs-list mailing list