Pascal Chambon wrote:
And let the filepointer untouched, simply because there are no reasons to move it,
On some systems it may not be possible for the file pointer to be positioned past the end of the file (I think Classic MacOS was like that).
I had the feeling that IOErrors were for operations on file streams (opening, writing/reading, closing...), whereas OSErrors were for manipulations on filesystems (renaming, linking, stating...)
I always thought the distinction was that IOError contains a C library errno value, whereas OSError contains an OS-specific error code. So system calls that aren't part of the C stdlib need to use OSError, at least on some platforms. I don't see that file errors vs. everything else is a very useful distinction to make when catching exceptions. I almost always end up catching EnvironmentError to make sure I get both, particularly when working cross-platform. What we could do with is better platform-independent ways of distinguishing particular error conditions, such as file not found, out of space, etc., either using subclasses of IOError or mapping error codes to a set of platform-independent ones. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com