Message8064

Author jamesls
Recipients jamesls
Date 2013-07-14.19:39:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1373830766.98.0.830500655039.issue2068@psf.upfronthosting.co.za>
In-reply-to
Content
The actual issue appears to be with the O_APPEND flag, if I remove this option, I get the correct behavior the first time the script is run, but then of course the second time around the file is not appended to (as expected since O_APPEND is not specified).

import os

fd = os.open('testfile', os.O_RDWR|os.O_CREAT)
os.write(fd, bytes('one'))
os.write(fd, bytes('two'))
os.write(fd, bytes('three'))
os.close(fd)

with open('testfile', 'rb') as f:
    print(f.read())


$ jython /tmp/repro.py
onetwothree
History
Date User Action Args
2013-07-14 19:39:26jameslssetmessageid: <1373830766.98.0.830500655039.issue2068@psf.upfronthosting.co.za>
2013-07-14 19:39:26jameslssetrecipients: + jamesls
2013-07-14 19:39:26jameslslinkissue2068 messages
2013-07-14 19:39:26jameslscreate