diff -r 56a05d7bb395 src/org/python/core/io/FileIO.java --- a/src/org/python/core/io/FileIO.java Fri Aug 23 11:59:59 2013 -0700 +++ b/src/org/python/core/io/FileIO.java Tue Sep 03 14:07:10 2013 -0700 @@ -72,7 +72,7 @@ File absPath = new RelativeFile(name.toString()); try { - if (appending && !(reading || plus)) { + if ((appending && !(reading || plus)) || (writing && !reading)) { // Take advantage of FileOutputStream's append mode fromFileOutputStream(absPath); } else { @@ -181,7 +181,7 @@ * @param absPath The absolute path File to open */ private void fromFileOutputStream(File absPath) throws FileNotFoundException { - fileOutputStream = new FileOutputStream(absPath, true); + fileOutputStream = new FileOutputStream(absPath, appending); fileChannel = fileOutputStream.getChannel(); }