1 Dec 2002 02:55
[ python-Bugs-521782 ] unreliable file.read() error handling
<noreply <at> sourceforge.net>
2002-12-01 01:55:42 GMT
2002-12-01 01:55:42 GMT
Bugs item #521782, was opened at 2002-02-23 13:44 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=521782&group_id=5470 Category: Python Library Group: None Status: Open Resolution: None Priority: 8 Submitted By: Marius Gedminas (mgedmin) >Assigned to: Martin v. Löwis (loewis) Summary: unreliable file.read() error handling Initial Comment: fread(3) manual page states fread and fwrite return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or zero). Python only checks ferror status when the return value is zero (Objects/fileobject.c line 550 from Python-2.1.2 sources). I agree that it is a good idea to delay exception throwing until after the user has processed the partial chunk of data returned by fread, but there are two problems with the current implementation: loss of errno and occasional loss of data.(Continue reading)
RSS Feed