piranna / pyfilesystem

Automatically exported from code.google.com/p/pyfilesystem
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

ReadOnlyFS doesn't prevent files being opened in r+ mode #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
>>> from fs.osfs import OSFS
>>> from fs.wrapfs.readonlyfs import ReadOnlyFS
>>> myfs = OSFS('.')
>>> myfs.setcontents('testfile', 'something or other\n')
>>> rofs = ReadOnlyFS(myfs)
>>> f = rofs.open('testfile', 'r+')
>>> f.read()
'something or other\n'
>>> f.write('this should fail\n')
>>> f.close()
>>> rofs.open('testfile','r').read()
'something or other\nthis should fail\n'

What is the expected output?
I'd expect the file to not be modifed.

Original issue reported on code.google.com by gc...@loowis.durge.org on 1 Sep 2012 at 11:38

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r814.

Original comment by gc...@loowis.durge.org on 1 Sep 2012 at 11:42