From: <no...@so...> - 2000-12-05 19:26:44
|
Bug #122816, was updated on 2000-Nov-18 11:09 Here is a current snapshot of the bug. Project: Jython Category: Core Status: Open Resolution: None Bug Group: None Priority: 5 Submitted by: bckfnn Assigned to : Nobody Summary: read () doesn't always read to EOF Details: In CPython, the read () method of file objects is stated to return the entire contents of the file. When similar code is run under JPython, however, it frequently only seems to return part of the file. It's as if it relies on the Java "read (buffer)" API which is not guaranteed to actually read the entire file, but never checks the results. The best way to test this appears to be to try loading a reasonably long page over a network connection, as this is most likely to cause the JPython code to fail. For Example: slashdotfile = urllib.urlopen ('http://www.slashdot.org/') page = slashdotfile.read () print page This will almost always only get about half the page under JPython. Follow-Ups: Date: 2000-Nov-26 07:20 By: bckfnn Comment: The original problem is solved, but using the new httplob from CPython2.0 causes a new bug. The socket gets closed right after reading the response with HTTP.getresponse(). The body will then be read through a dup'ed fd with sock.makefile(). Jython does not support the dupping. When the socket is closed, the sock.makefile file is close closed. ------------------------------------------------------- Date: 2000-Dec-05 11:27 By: bckfnn Comment: Fixed in Lib/socket.py revision: 1.8. ------------------------------------------------------- For detailed info, follow this link: http://sourceforge.net/bugs/?func=detailbug&bug_id=122816&group_id=12867 |