Difference between IOError and OSError?
问题 I am always getting confused on whether a function would raise an IOError or OSError (or both?). What is the principle rule behind these exception types, what is the difference between them and when is which raised? I've initially thought OSError is for things like permission denial, but opening a file without permissions will raise an IOError. 回答1: There is very little difference between the two types. In fact, even the core Python developers agreed that there is no real difference and