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.

Author bmearns
Recipients bmearns
Date 2009-04-30.18:28:18
SpamBayes Score 1.7763568e-15
Marked as misclassified No
Message-id <1241116100.06.0.276322653454.issue5887@psf.upfronthosting.co.za>
In-reply-to
Content
Created an mmap for a file in update mode, seek to end of file, and
invoke write_byte. The file is not updated (as expected), but did not
get any error indicating the write was out of bounds, and when I invoke
tell(), it reports a position that is out of bounds. I check size(), and
it still reports the correct size (less than the value reported by
tell()). If I do seek(0, os.SEEK_END), it correctly returns to the end
of the map, instead of this bizarre no-mans land beyond the end.

This is on Windows XP.

Here's an example from the shell. (note that write() works as I would
expect, it raises an exception and doesn't modify the position):

>>> map.tell()
0
>>> map.size()
8
>>> map.seek(0, os.SEEK_END)
>>> map.tell()
8
>>> map.write("foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: data out of range
>>> map.tell()
8
>>> map.size()
8
>>> map.write_byte('x')
>>> map.tell()
9
>>> map.size()
8
>>> print "WTF?"
WTF?
>>> map.write_byte('x')
>>> map.tell()
10
>>> map.size()
8
>>> map.flush()
1
>>> map.size()
8
>>> map.tell()
10
>>> map.seek(0, os.SEEK_END)
>>> map.tell()
8
>>> map.size()
8
>>>
History
Date User Action Args
2009-04-30 18:28:20bmearnssetrecipients: + bmearns
2009-04-30 18:28:20bmearnssetmessageid: <1241116100.06.0.276322653454.issue5887@psf.upfronthosting.co.za>
2009-04-30 18:28:18bmearnslinkissue5887 messages
2009-04-30 18:28:18bmearnscreate