[Jython-checkins] jython (merge default -> default): Merge with tip.

frank.wierzbicki jython-checkins at python.org
Thu Apr 28 18:06:40 CEST 2011


http://hg.python.org/jython/rev/3b893248b9e1
changeset:   6199:3b893248b9e1
parent:      6198:061fda1cd269
parent:      6197:21b0a84bbcf4
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Thu Apr 28 09:05:30 2011 -0700
summary:
  Merge with tip.

files:
  Lib/test/test_fileno.py                       |  4 +++-
  NEWS                                          |  4 +++-
  src/org/python/modules/posix/PosixModule.java |  4 ++--
  3 files changed, 8 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_fileno.py b/Lib/test/test_fileno.py
--- a/Lib/test/test_fileno.py
+++ b/Lib/test/test_fileno.py
@@ -46,7 +46,9 @@
         self.fp.write('jython filenos')
         self.fp.flush()
         self.fp.seek(0)
-        self.assertEqual(os.read(self.fd, 7), 'jython ')
+        result = os.read(self.fd, 7)
+        self.assertTrue(isinstance(result, str))
+        self.assertEqual(result, 'jython ')
         self.assertEqual(os.read(self.fd, 99), 'filenos')
         self.fp.close()
         raises(OSError, 9, os.read, self.fd, 1)
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -3,10 +3,12 @@
 Jython 2.6a1
   Bugs Fixed
     - [ 1727 ] Error in Jython 2.5.2 with os.stat and varargs
+    - [ 1735 ] return type of os.read is unicode, not str
   New Features
     - The Jython development repository has been converted from
       Subversion to Mercurial (almost)! A test repository is now
-      hosted @ http://hg.python.org/jython WOOHOO!
+      hosted @ http://hg.python.org/jython
+    - Tests on the new hg repository are positive so far
 
 Jython 2.5.2
   same as 2.5.2rc4
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
@@ -609,9 +609,9 @@
     public static PyString __doc__read = new PyString(
         "read(fd, buffersize) -> string\n\n" +
         "Read a file descriptor.");
-    public static String read(PyObject fd, int buffersize) {
+    public static PyObject read(PyObject fd, int buffersize) {
         try {
-            return StringUtil.fromBytes(FileDescriptors.get(fd).read(buffersize));
+            return new PyString(StringUtil.fromBytes(FileDescriptors.get(fd).read(buffersize)));
         } catch (PyException pye) {
             throw badFD();
         }

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


More information about the Jython-checkins mailing list