[ python-Bugs-1488717 ] appended file on Windows reads arbitrary data

SourceForge.net noreply at sourceforge.net
Mon May 15 11:08:07 CEST 2006


Bugs item #1488717, was opened at 2006-05-15 18:08
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=1488717&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: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: muimi (muimi)
Assigned to: Nobody/Anonymous (nobody)
Summary: appended file on Windows reads arbitrary data

Initial Comment:
checked with versions 2.3 & 2.4.2 on Windows 2000 & XP

reading an appended file without resetting its
current position causes reading/writing of arbitrary data.
this appears to be related to the MS Visual Studio C
library.

def bug(filename):
    af=open(filename,'a+')
    af.write('\nlast line?')
    print af.tell()
    d=af.read() # this causes a read/write problem
    print len(d), af.tell()
    af.close()

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

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


More information about the Python-bugs-list mailing list