Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Python 2 is very platform-dependent: fdopen simply call the C function fdopen() and returns a FILE*. Since the sample code is a mistake (read on a file open in write mode), how and when the error shows up really depends on the platform's implementation of the FILE* object.
On the other hand Python 3 re-implemented all this, no FILE is used. The io.UnsupportedOperation("BufferedWriter.read() not supported") is much better IMO. And note that io.UnsupportedOperation is a IOError as well. However the AttributeError is inconsistent. The attached patch turns it into a UnsupportedOperation as above. ---------- keywords: +needs review, patch nosy: +amaury.forgeotdarc priority: -> normal versions: -Python 2.4, Python 2.5 Added file: http://bugs.python.org/file12276/bad_readline.patch _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4579> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com