A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-September/092198.html below:

[Python-Dev] IO module precisions and exception hierarchy

[Python-Dev] IO module precisions and exception hierarchy [Python-Dev] IO module precisions and exception hierarchyMichael Foord fuzzyman at voidspace.org.uk
Mon Sep 28 12:03:35 CEST 2009
Greg Ewing wrote:
> Michael Foord wrote:
>
>> Some of the error messages are truly awful though as things stand, 
>> especially for someone new to Python. Try to read from a file handle 
>> opened in read mode for example: IOError: [Errno 9] Bad file descriptor
>
> Subdividing the IOError exception won't help with
> that, because all you have to go on when deciding
> which exception to raise is the error code returned
> by the OS. If the same error code results from a
> bunch of different things, there's not much Python
> can do to sort them out.
>

Well, the file type knows what mode it is opened in so catching these 
errors is really not difficult at all.

Michael


> The error messages produced for the various error
> codes could perhaps be improved, but that's an
> orthogonal issue.
>


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4