Used OSError instead of FileNotExistError for py27 compatibility