mmap.mmap (f.fileno(), 0, prot=mmap.PROT_READ) error: [Errno 22] Invalid argument According to http://docs.python.org/library/mmap.html, mmap on _windows_ doesn't accept 0-length file. But this was tested on linux. Is this a bug? I don't see anything in linux man-page about the underlying C mmap function not accepting 0-length files.