Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/subscriptions/bin/updateMalwareDomainsList.py

Issue 29821558: Issue #6707 - Make the generated malware domain filter list encode domains as Punycode (Closed)
Patch Set: Created July 3, 2018, 3:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/subscriptions/bin/updateMalwareDomainsList.py
diff --git a/sitescripts/subscriptions/bin/updateMalwareDomainsList.py b/sitescripts/subscriptions/bin/updateMalwareDomainsList.py
index a2cfb5ff8d46bfe4534dc79f0f03f47e31257519..c2f208228717f4e3122a4bc95cbb39f6f66c8a36 100644
--- a/sitescripts/subscriptions/bin/updateMalwareDomainsList.py
+++ b/sitescripts/subscriptions/bin/updateMalwareDomainsList.py
@@ -60,7 +60,7 @@ def main():
subprocess.check_call(['hg', '-q', 'up', '-R', tempdir, '-r', 'default'])
path = os.path.join(tempdir, 'malwaredomains_full.txt')
- file = codecs.open(path, 'wb', encoding='utf-8')
+ file = codecs.open(path, 'wb')
print >>file, FILTERLIST_HEADER
@@ -80,7 +80,7 @@ def main():
if not domain:
continue
- print >>file, '||%s^' % domain.decode('idna')
+ print >>file, '||%s^' % domain.decode('idna').encode('punycode')
file.close()
if subprocess.check_output(['hg', 'stat', '-R', tempdir]) != '':

Powered by Google App Engine
This is Rietveld