From 140c0bd29ef27cb90f5597e3821901e52773c760 Mon Sep 17 00:00:00 2001 From: Alexander Cecile <35971201+AlexanderCecile@users.noreply.github.com> Date: Thu, 20 Aug 2020 16:15:37 -0400 Subject: [PATCH] Use domain_to_idna in get_file_by_url --- updateHostsFile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/updateHostsFile.py b/updateHostsFile.py index b8d64a29c..ad31a246b 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -1466,10 +1466,11 @@ def maybe_copy_example_file(file_path): shutil.copyfile(example_file_path, file_path) -def get_file_by_url(url, params, **kwargs): +def get_file_by_url(url, params=None, **kwargs): req = requests.get(url=url, params=params, **kwargs) req.encoding = req.apparent_encoding - return req.text + res_text = "\n".join([domain_to_idna(line) for line in req.text.splitlines()]) + return res_text def write_data(f, data):