What is the meaning of os.error?

Why does the Python os module contain error , an alias for OSError ?

Is there any reason to ever pronounce it os.error ? OSError certainly seems to be more compatible with all other built-in exceptions.

I was hoping os.py shed some light, but sometimes it uses the error and OSError others.

It seems to have an extra name for one of the exceptions, but it survives in Python 3.0. What am I missing?

+7
python
source share
1 answer

The documentation for OSError says that it was added in version 1.5.2. I assume that error precedes this a bit and in an attempt to remain backward compatible with code written for Python, an alias for OSError was made before 1.5.2 error .

+6
source share

All Articles