This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients
Date 2007-05-01.14:38:38
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The latest patch works on Mac OS 10.4 . I would suggest a few cosmetic changes:

1. Put the flag checking logic in a separate function and call it instead of fread.  This will eliminate code duplication.
2. "else" is redundant in

+                       if (ferror(stream)) {
+                               clearerr(stream);
+                               PyErr_SetFromErrno(PyExc_IOError);
+                               return 0;
+                       } else if (feof(stream)) {
+                               clearerr(stream);
+                       }

The flow will be more obvious if you write

+                       if (ferror(stream)) {
+                               clearerr(stream);
+                               PyErr_SetFromErrno(PyExc_IOError);
+                               return 0;
+                       } 
+                       if (feof(stream)) {
+                               clearerr(stream);
+                       }

3. Please mention bug 1523853 in a comment near the test.  

otherwise, the patch looks fine.
History
Date User Action Args
2007-08-23 15:58:13adminlinkissue1706039 messages
2007-08-23 15:58:13admincreate