[Tutor] Attempting to install Boa Constructor - User ErrorDetected

Alan Gauld alan.gauld at blueyonder.co.uk
Thu Aug 19 00:38:03 CEST 2004


> It has often troubled me that programs (python included) report
"can't open
> file" when it is more accurate and useful to report "can't find
file".

In principle I agree but...

> So I recommend that in a future version of Python we fix this
message.

I believe the problem is at the level of the OS open() call which
simply
returns an error (-1) with no distinction as to why it failed. Thus
Python's
open() call would need to be rewritten to do all sorts of tests before
trying to open the file (or after detecting the error I suppose...).
This would be friendly but make filehandling very slow where multiple
files had to be opened.

Of course if a proper File object were created that wrapped the low
level calls, then normal users could use File("foo") and hard core
performance junkies could still use open("foo").

Alan G




More information about the Tutor mailing list