This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: resize readonly memory mapped file
Type: Stage:
Components: Windows Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: tim.peters Nosy List: makaron, tim.peters
Priority: normal Keywords:

Created on 2002-07-05 14:07 by makaron, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (5)
msg11491 - (view) Author: Grzegorz Makarewicz (makaron) Date: 2002-07-05 14:07
When file is open as readonly and mmf if created as R/O
too, then resizing this mapping will change its
protection and desired acces to read-write.
msg11492 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2002-08-27 20:09
Logged In: YES 
user_id=31435

Which version of Python are you talking about?  Also, please 
give a concrete example so we don't have to guess at what 
you mean.  Here's mine:

"""
import mmap

f = open('in.txt', 'rb')
m = mmap.mmap(f.fileno(), 0, 
access=mmap.ACCESS_READ)
f.close()

print `m[:]`
m.resize(5)
"""
The m.resizes() attempt yields a TypeError, "mmap can't 
resize a readonly or copy-on-write memory map".  I tried this 
under current CVS, and under 2.2.1, on Win2K.
msg11493 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2002-09-10 14:57
Logged In: YES 
user_id=31435

If the requested followup info isn't forthcoming, I can only 
close this as Irreproducible.
msg11494 - (view) Author: Grzegorz Makarewicz (makaron) Date: 2002-09-10 16:22
Logged In: YES 
user_id=115179

Sorry, i was out of internet ;(

My python is 2.1 on windows, under 2.2 or cvs MMF works as 
expected - my fault.
msg11495 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2002-09-25 19:45
Logged In: YES 
user_id=31435

Closed, as the OP confirmed it was specific to 2.1.  If anyone 
volunteers to do another release in the 2.1 line, perhaps this 
should be revisited.
History
Date User Action Args
2022-04-10 16:05:29adminsetgithub: 36854
2002-07-05 14:07:33makaroncreate