[Python-Dev] win32 specific exception in the core?

Mark Hammond mhammond@skippinet.com.au
Thu, 17 Feb 2000 12:50:58 +1100


[Guido]
>
> I do like it better if Win32Error derives from OSError.
>
> Shouldn't it be just WinError or WindowsError?  I don't see why a
> different exception should be used for Win64.
>
> >  which would lead to people writing "except IOOError:"
>
> I don't understand this -- Win32Error isn't derived from IOError.

Oops - I meant OSError.

What I meant is that people will say:
try:
  win32reg.Something()
except IOError, ...

Rather than the specific error.  This makes our specific Windows exception,
basically, an internal mechanism to get the error messages lined up with the
error number.  Not that this is a problem, but I just thought it worth
mentioning.

OK - so lets go with:

WindowsError(OSError):
  ...

If no one complains, I will submit the relevant patches to Exception.py
along with my win32reg.c (I can leave string-based exceptions out, yes?)

Mark.