[Jython-checkins] jython: Fix wrong name expected for file() keyword argument.

jeff.allen jython-checkins at python.org
Sat Nov 30 17:52:45 CET 2013


http://hg.python.org/jython/rev/18c94ce2ce25
changeset:   7156:18c94ce2ce25
user:        Jeff Allen <ja.py at farowl.co.uk>
date:        Wed Nov 20 21:16:21 2013 +0000
summary:
  Fix wrong name expected for file() keyword argument.
Should be 'buffering' not 'bufsize': this must go back some time!

files:
  Lib/test/test_file2k.py                       |  1 -
  src/org/python/core/PyFile.java               |  2 +-
  src/org/python/core/__builtin__.java          |  2 +-
  src/org/python/modules/posix/PosixModule.java |  2 +-
  4 files changed, 3 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_file2k.py b/Lib/test/test_file2k.py
--- a/Lib/test/test_file2k.py
+++ b/Lib/test/test_file2k.py
@@ -582,7 +582,6 @@
             print >> f, ''
         self._test_close_open_io(io_func)
 
-    @unittest.skipIf(test_support.is_jython, "FIXME: Not working on Jython")
     def test_close_open_print_buffered(self):
         self.use_buffering = True
         def io_func(f):
diff --git a/src/org/python/core/PyFile.java b/src/org/python/core/PyFile.java
--- a/src/org/python/core/PyFile.java
+++ b/src/org/python/core/PyFile.java
@@ -139,7 +139,7 @@
     @ExposedNew
     @ExposedMethod(doc = BuiltinDocs.file___init___doc)
     final void file___init__(PyObject[] args, String[] kwds) {
-        ArgParser ap = new ArgParser("file", args, kwds, new String[] {"name", "mode", "bufsize"},
+        ArgParser ap = new ArgParser("file", args, kwds, new String[] {"name", "mode", "buffering"},
                                      1);
         PyObject name = ap.getPyObject(0);
         if (!(name instanceof PyString)) {
diff --git a/src/org/python/core/__builtin__.java b/src/org/python/core/__builtin__.java
--- a/src/org/python/core/__builtin__.java
+++ b/src/org/python/core/__builtin__.java
@@ -1720,7 +1720,7 @@
 
     @Override
     public PyObject __call__(PyObject args[], String kwds[]) {
-        ArgParser ap = new ArgParser("file", args, kwds, new String[] {"name", "mode", "bufsize"},
+        ArgParser ap = new ArgParser("file", args, kwds, new String[] {"name", "mode", "buffering"},
                                      1);
         PyObject obj = ap.getPyObject(0);
         if (obj.getJavaProxy() != null) {
diff --git a/src/org/python/modules/posix/PosixModule.java b/src/org/python/modules/posix/PosixModule.java
--- a/src/org/python/modules/posix/PosixModule.java
+++ b/src/org/python/modules/posix/PosixModule.java
@@ -738,7 +738,7 @@
             if (!file.canWrite()) {
                 throw Py.OSError(Errno.EPERM, path);
             }
-            throw Py.OSError("unlink(): an unknown error occurred" + absolutePath);
+            throw Py.OSError("unlink(): an unknown error occurred: " + absolutePath);
         }
     }
 

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list