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: appended file on Windows reads arbitrary data
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, muimi
Priority: normal Keywords:

Created on 2006-05-15 11:09 by muimi, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg28529 - (view) Author: muimi (muimi) Date: 2006-05-15 11:09
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()
msg28530 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-05-15 19:26
Logged In: YES 
user_id=849994

Dupe of #1488717.
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43358
2006-05-15 11:09:26muimicreate