use OSError for compatibility with python 3.2