SF.net SVN: jython:[7288] branches/Release_2_5maint

[email protected] Sat, 23 Apr 2011 00:27:31 +0000
Newsgroups gmane.comp.lang.jython.cvs
Message-ID <[email protected]>
Revision: 7288
          http://jython.svn.sourceforge.net/jython/?rev=7288&view=rev
Author:   pjenvey
Date:     2011-04-23 00:27:30 +0000 (Sat, 23 Apr 2011)

Log Message:
-----------
Merged revisions 7287 via svnmerge from 
https://jython.svn.sourceforge.net/svnroot/jython/trunk

........
  r7287 | pjenvey | 2011-04-22 17:17:56 -0700 (Fri, 22 Apr 2011) | 3 lines
  
  fix os.read returning unicode instead of str
  fixes #1735
........

Modified Paths:
--------------
    branches/Release_2_5maint/jython/Lib/test/test_fileno.py
    branches/Release_2_5maint/jython/NEWS
    branches/Release_2_5maint/jython/src/org/python/modules/posix/PosixModule.java

Property Changed:
----------------
    branches/Release_2_5maint/
    branches/Release_2_5maint/jython/


Property changes on: branches/Release_2_5maint
___________________________________________________________________
Modified: svnmerge-integrated
   - /trunk:1-7207,7210,7285
   + /trunk:1-7207,7210,7285,7287
Modified: svn:mergeinfo
   - /trunk:7210,7285
   + /trunk:7210,7285,7287


Property changes on: branches/Release_2_5maint/jython
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/jsr223:6285-6565
/branches/newstyle-java-types:5564-5663,5666-5729
/trunk/jython:7210,7285
   + /branches/jsr223:6285-6565
/branches/newstyle-java-types:5564-5663,5666-5729
/trunk/jython:7210,7285,7287

Modified: branches/Release_2_5maint/jython/Lib/test/test_fileno.py
===================================================================
--- branches/Release_2_5maint/jython/Lib/test/test_fileno.py	2011-04-23 00:17:56 UTC (rev 7287)
+++ branches/Release_2_5maint/jython/Lib/test/test_fileno.py	2011-04-23 00:27:30 UTC (rev 7288)
@@ -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)

Modified: branches/Release_2_5maint/jython/NEWS
===================================================================
--- branches/Release_2_5maint/jython/NEWS	2011-04-23 00:17:56 UTC (rev 7287)
+++ branches/Release_2_5maint/jython/NEWS	2011-04-23 00:27:30 UTC (rev 7288)
@@ -3,6 +3,7 @@
 Jython 2.5.3a1
   Bugs Fixed
     - [ 1727 ] Error in Jython 2.5.2 with os.stat and varargs
+    - [ 1735 ] return type of os.read is unicode, not str
 
 Jython 2.5.2
   same as 2.5.2rc4

Modified: branches/Release_2_5maint/jython/src/org/python/modules/posix/PosixModule.java
===================================================================
--- branches/Release_2_5maint/jython/src/org/python/modules/posix/PosixModule.java	2011-04-23 00:17:56 UTC (rev 7287)
+++ branches/Release_2_5maint/jython/src/org/python/modules/posix/PosixModule.java	2011-04-23 00:27:30 UTC (rev 7288)
@@ -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();
         }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails