switched FileNotFoundError to IOError for Python2 compatibility.