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 vstinner
Recipients ivank, neologix, pitrou, python-dev, vstinner
Date 2014-07-02.22:38:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
For Python 2, looks wrong: if only checks ferror() if fread() returns 0, whereas Py_UniversalNewlineFread() can call fread() more than once, and according to fread() manual page, fread() result can be different than 0 on error.

"If an error occurs, or the end of the file is reached, the return value is a short item count (or zero)."

Attached fileobject.c rewrites error handling in fileobject.c. The main change if that ferror() is called even if fread() does not return 0.
Date User Action Args
2014-07-02 22:38:34vstinnersetrecipients: + vstinner, pitrou, ivank, neologix, python-dev
2014-07-02 22:38:33vstinnersetmessageid: <>
2014-07-02 22:38:33vstinnerlinkissue21090 messages
2014-07-02 22:38:33vstinnercreate