git.99rst.org
/
stevenblack-hosts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
79bd7d4
)
Use domain_to_idna in get_file_by_url
author
Alexander Cecile
<redacted>
Thu, 20 Aug 2020 20:15:37 +0000
(16:15 -0400)
committer
Alexander Cecile
<redacted>
Thu, 20 Aug 2020 20:15:37 +0000
(16:15 -0400)
updateHostsFile.py
patch
|
blob
|
history
diff --git
a/updateHostsFile.py
b/updateHostsFile.py
index b8d64a29cf5c592e5666d7b2efc6eb14242b7aec..ad31a246ba896c98092fd7978e8f863f71694e90 100644
(file)
--- 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):
git clone https://git.99rst.org/PROJECT