[Python-Dev] POSIX [Fuzziness in io module specs] (original) (raw)

Daniel Stutzbach daniel at stutzbachenterprises.com
Sat Sep 19 12:37:07 CEST 2009


On Sat, Sep 19, 2009 at 5:31 AM, Pascal Chambon <chambon.pascal at gmail.com>wrote:

Actually, since Windows Error Codes concern any possible error (IO, file permissions, memory problems...), I thought the best would be to convert them to the most appropriate python standard exception, only defaulting to WindowsError (i.e, OSError's hierarchy) when no other exception type matches. So at the moment, I use a decorator to automatically convert all errors on stream operations into IOErrors. Error codes are not the same as unix ones indeed, but I don't know if it's really important (imo, most people just want to know if the operation was successful, I don't know if many developers scan error codes to act accordingly).

I don't often need to check the error code at runtime but seeing the corresponding message is often critical for debugging.

-- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20090919/f68e6350/attachment.htm>



More information about the Python-Dev mailing list