replaced PermissionError (Pycharm thing) with IOError