Index: Modules/mmapmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v retrieving revision 2.45 diff -u -r2.45 mmapmodule.c --- Modules/mmapmodule.c 3 May 2003 09:14:53 -0000 2.45 +++ Modules/mmapmodule.c 14 Jul 2003 19:56:57 -0000 @@ -901,7 +901,8 @@ /* on OpenVMS we must ensure that all bytes are written to the file */ fsync(fd); # endif - if (fstat(fd, &st) == 0 && (size_t)map_size > st.st_size) { + if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode) && + (size_t)map_size > st.st_size) { PyErr_SetString(PyExc_ValueError, "mmap length is greater than file size"); return NULL;