Update of /cvsroot/jython/jython/org/python/core
In directory usw-pr-cvs1:/tmp/cvs-serv26682
Modified Files:
PyFile.java
Log Message:
Fix for [ #417665 ] open(filename, "a") fails to append.
Note that the docs for open() leaves itundefined regarding how much
the append flag actually means.
Index: PyFile.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/PyFile.java,v
retrieving revision 2.19
retrieving revision 2.20
diff -C2 -r2.19 -r2.20
*** PyFile.java 2001/07/14 22:27:46 2.19
--- PyFile.java 2001/07/16 10:57:21 2.20
***************
*** 721,727 ****
java.io.RandomAccessFile rfile =
new java.io.RandomAccessFile(f, jmode);
- if (c1 == 'a')
- rfile.seek(rfile.length());
RFileWrapper iofile = new RFileWrapper(rfile);
return iofile;
} catch (java.io.IOException e) {
--- 721,727 ----
java.io.RandomAccessFile rfile =
new java.io.RandomAccessFile(f, jmode);
RFileWrapper iofile = new RFileWrapper(rfile);
+ if (c1 == 'a')
+ iofile.seek(0, 2);
return iofile;
} catch (java.io.IOException e) {
|