Update of /cvsroot/jython/jython/org/python/core
In directory usw-pr-cvs1:/tmp/cvs-serv5145
Modified Files:
PyFile.java
Log Message:
Check for valid open mode flags.
Index: PyFile.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/PyFile.java,v
retrieving revision 2.25
retrieving revision 2.26
diff -C2 -d -r2.25 -r2.26
*** PyFile.java 16 Dec 2001 11:22:22 -0000 2.25
--- PyFile.java 26 May 2002 20:34:11 -0000 2.26
***************
*** 722,725 ****
--- 722,729 ----
char c3 = ' ';
int n = mode.length();
+ for (int i = 0; i < n; i++) {
+ if ("awrtb+".indexOf(mode.charAt(i)) < 0)
+ throw Py.IOError("Unknown open mode:" + mode);
+ }
if (n > 0) {
c1 = mode.charAt(0);
|