[ python-Bugs-1341031 ] mmap does not accept length as 0

SourceForge.net noreply at sourceforge.net
Fri Oct 28 22:26:49 CEST 2005


Bugs item #1341031, was opened at 2005-10-28 15:26
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1341031&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: liturgist (liturgist)
Assigned to: Nobody/Anonymous (nobody)
Summary: mmap does not accept length as 0

Initial Comment:
Creating an mmap object does not accept a length
parameter of zero on Linux FC4 and Cygwin.  However, it
does on Windows XP.

$ ls -al t.dat
-rw-r--r--  1 pwatson mkgroup-l-d 64 Oct 28 10:13 t.dat

$ python
Python 2.4.1 (#1, May 27 2005, 18:02:40)
[GCC 3.3.3 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for
more information.
>>> import mmap
>>> fp = open('t.dat', 'rb')
>>> b = mmap.mmap(fp.fileno(), 0, access=mmap.ACCESS_READ)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
EnvironmentError: [Errno 22] Invalid argument
>>> b = mmap.mmap(fp.fileno(), 64, access=mmap.ACCESS_READ)
>>> b.size()
64

=====
$ ls -al .profile
-rwxrwxr-x  1 pwatson pwatson 1920 Jul 22 06:57 .profile

$ python
Python 2.4.1 (#1, Jul 19 2005, 14:16:43)
[GCC 4.0.0 20050519 (Red Hat 4.0.0-8)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import mmap
>>> fp = open('.profile', 'rb')
>>> b = mmap.mmap(fp.fileno(), 0, access=mmap.ACCESS_READ)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
EnvironmentError: [Errno 22] Invalid argument
>>> b = mmap.mmap(fp.fileno(), 1920,
access=mmap.ACCESS_READ)
>>> b.size()
1920

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1341031&group_id=5470


More information about the Python-bugs-list mailing list