Skip to content

Commit 9885526

Browse files
committed
Convert securecookie validation to py3.6
1 parent d311767 commit 9885526

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

test/validations.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
utils/remove-obsolete-references.sh
55
test/validations/path/run.sh
66
test/validations/test-coverage/run.sh
7-
python2.7 test/validations/securecookie/run.py
7+
python3.6 test/validations/securecookie/run.py
88
python2.7 test/validations/filename/run.py
99
python2.7 test/validations/relaxng/run.py
1010
python2.7 test/validations/special/run.py --quiet

test/validations/securecookie/run.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/bin/env python2.7
1+
#!/usr/bin/env python3.6
22

33
# This python utility check for wildcard securecookies which
4-
# can be normalized, warn and exit with non-zero when such
5-
# rulesets exist.
4+
# can be normalized, warn and exit with non-zero when such
5+
# rulesets exist.
66

77
# This is create in attempt to fix the issues on
88
# https://github.com/EFForg/https-everywhere/pull/13840
@@ -16,10 +16,10 @@
1616

1717
def normalize_fn(fn):
1818
"""
19-
OSX and Linux filesystems encode composite characters differently in
19+
OSX and Linux filesystems encode composite characters differently in
2020
filenames. We should normalize to NFC: https://unicode.org/reports/tr15/
2121
"""
22-
fn = unicodedata.normalize("NFC", unicode(fn, "utf-8")).encode()
22+
fn = unicodedata.normalize("NFC", fn)
2323
return fn
2424

2525
def should_normalize_securecookie(host, name):
@@ -50,8 +50,8 @@ def should_normalize_securecookie(host, name):
5050
name = branch.attrib["name"]
5151

5252
if should_normalize_securecookie(host, name):
53-
print ("ERROR %s: contains wildcard securecookies "\
54-
"which can be normalized." % filename)
53+
print ("ERROR {}: contains wildcard securecookies "\
54+
"which can be normalized.".format(filename))
5555
exit_with_non_zero = True
5656
break
5757

0 commit comments

Comments
 (0)