Index: Modules/mmapmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v retrieving revision 2.45 diff -c -r2.45 mmapmodule.c *** Modules/mmapmodule.c 3 May 2003 09:14:53 -0000 2.45 --- Modules/mmapmodule.c 27 Jun 2003 03:19:01 -0000 *************** *** 901,907 **** /* 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) { PyErr_SetString(PyExc_ValueError, "mmap length is greater than file size"); return NULL; --- 901,909 ---- /* on OpenVMS we must ensure that all bytes are written to the file */ fsync(fd); # endif ! if (fstat(fd, &st) == 0 && ! !S_ISCHR(st.st_mode) && ! (size_t)map_size > st.st_size) { PyErr_SetString(PyExc_ValueError, "mmap length is greater than file size"); return NULL;