Is errno.ENOENT the right value?

Mike Thompson n/a
Tue May 13 00:52:30 EDT 2003


>
> I would guess it's because it's a WindowsError, not a OSError.

Oh, of course!!!!

>
>  So that 3 is some Windows-specific value, not an errno value.
>

Yes, which is puzzling.  Why would:
     os.listdir(path)
throw a WindowsError for something like 'path not found'.  Surely that's rather
a vanilla error, not at all specific to Windows?  Wouldn't an exception of
os.error with a code of errno.ENOENT make writting portable code just a bit
easier?

Appologies if my newbie-ness is getting in the way of me seeing something
obvious.

--
Mike






More information about the Python-list mailing list