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

Mark Hammond mhammond@skippinet.com.au
Sat, 12 Feb 2000 12:44:53 +1100


Im looking for closure on the Win32 specific exception.  Summary for those
that missed the thread:

* I would like a standard exception for Win32 specific errors.  The new
hopefully-to-be-standard "win32reg" module could make use of it, the win32
extensions could switch to it.  It is, in my mind at least, analogous to
OSError.

* I proposed deriving the new exception from EnvironmentError, like OSError
is.

* Fredrik replied with "why not use OSError then?".  I answered "due to the
numbering systems being different"

* Tim agreed that they should be different exceptions if they use different
numbering, but pointed out it could still be OSError with creative exception
hierarchies.

So, in summary, no one disagreed, and the only open issue was the exception
hierarchy.  My initial proposal called for:

StandardError:
-> EnvironmentError:
   -> IOError
   -> OSError
   -> Win32Error

 Which would generally lead to people writing "except Win32Error:"

Tim's suggestion (as I understand it) was:
StandardError:
-> EnvironmentError:
   -> IOError
   -> OSError
      -> CRTError (new - is what os.error would use)
      -> Win32Error (new)

 which would lead to people writing "except IOError:"

I still like my idea better - fits better with the existing "IOError", and
doesnt cause confusion with the change from os.error being OSError to
os.error being CRTError.

Guido:  Can you first make a "yes/no" decision, then (if necessary <wink>)
an either/or one?

Thanks,

Mark.