I looked into this for some other code I was working on (https://github.com/django/django/pull/1649), and `OSError` is the closest common ancestor that works with the various combinations of Python 2.7/3.3 and Windows/Unix.