bug? mmap doesn't like 0-length files

Cameron Simpson cs at zip.com.au
Mon Nov 22 22:00:59 EST 2010


On 23Nov2010 13:59, I wrote:
| On 22Nov2010 20:33, Neal Becker <ndbecker2 at gmail.com> wrote:
| |  mmap.mmap (f.fileno(), 0, prot=mmap.PROT_READ)
| | error: [Errno 22] Invalid argument
[...]
| | I don't see anything in linux man-page about the underlying C mmap function 
| | not accepting 0-length files.

It's worth noting that any time you get an errno error/exception then it
is almost certainly the underlying OS interface that has rejected your
request, not the python library.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Don't have awk? Use this simple sh emulation:
    #!/bin/sh
    echo 'Awk bailing out!' >&2
    exit 2
- Tom Horsley <tahorsley at csd.harris.com>



More information about the Python-list mailing list