Problems with "a+" open mode on v2.0 Windows?

Grant Munsey gmunsey at adobe.com
Thu Feb 15 09:37:24 EST 2001


On the win32 BeOpen Python 2.0 I have a strange thing happening.
(800 Mhz Win2k Pro)

The code below (abstracted from my actual app) dies randomly with
an io error 13 trying to open hdr1fname. This error happens about 20% of
the time. Not always on the same file name.

If I go and look at the file every thing is fine ... no access errors.
It's as if out1fn.close() is delayed some and the next call can't reopen the
file
for some reason.

Any clue to what's going on?

filelist = <10s of file names>

for i in filelist:
        parseFileEx(i)

def parsefileEx(hdr1fname):
        out1fn = open(hdr1fname, "a+")
        out1fn.write("blah\n");
        ... lots more writing ...
        out1fn.close()







More information about the Python-list mailing list