Like the other issue, but I have it in linux. with open(default_hoster , "r+") as hostfile: IOError: [Errno 13] Permission denied: 'etc/hosts'