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: Removed uncessary codecs call from updateMalwareDomains.py Created July 9, 2018, 1:08 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
« no previous file with comments | « .gitignore ('k') | sitescripts/subscriptions/test/test_updateMalwareDomainsList.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/subscriptions/bin/updateMalwareDomainsList.py
diff --git a/sitescripts/subscriptions/bin/updateMalwareDomainsList.py b/sitescripts/subscriptions/bin/updateMalwareDomainsList.py
index a2cfb5ff8d46bfe4534dc79f0f03f47e31257519..93d8644f28cd0c72e4c606d021a8ae5451087f8b 100644
--- a/sitescripts/subscriptions/bin/updateMalwareDomainsList.py
+++ b/sitescripts/subscriptions/bin/updateMalwareDomainsList.py
@@ -15,7 +15,6 @@
import os
import subprocess
-import codecs
import contextlib
import urllib2
import zipfile
@@ -60,7 +59,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 = open(path, 'wb')
print >>file, FILTERLIST_HEADER
@@ -80,11 +79,13 @@ def main():
if not domain:
continue
- print >>file, '||%s^' % domain.decode('idna')
+ print >>file, '||%s^' % domain
file.close()
if subprocess.check_output(['hg', 'stat', '-R', tempdir]) != '':
- subprocess.check_call(['hg', '-q', 'commit', '-R', tempdir, '-A', '-u', 'hgbot', '-m', 'Updated malwaredomains.com data'])
+ subprocess.check_call(['hg', '-q', 'commit', '-R', tempdir, '-A',
+ '-u', 'hgbot', '-m',
+ 'Updated malwaredomains.com data'])
subprocess.check_call(['hg', '-q', 'push', '-R', tempdir])
finally:
shutil.rmtree(tempdir, ignore_errors=True)
« no previous file with comments | « .gitignore ('k') | sitescripts/subscriptions/test/test_updateMalwareDomainsList.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld