|
1 | | -#!/usr/bin/env python2.7 |
| 1 | +#!/usr/bin/env python3.6 |
2 | 2 |
|
3 | 3 | # 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. |
6 | 6 |
|
7 | 7 | # This is create in attempt to fix the issues on |
8 | 8 | # https://github.com/EFForg/https-everywhere/pull/13840 |
|
16 | 16 |
|
17 | 17 | def normalize_fn(fn): |
18 | 18 | """ |
19 | | - OSX and Linux filesystems encode composite characters differently in |
| 19 | + OSX and Linux filesystems encode composite characters differently in |
20 | 20 | filenames. We should normalize to NFC: https://unicode.org/reports/tr15/ |
21 | 21 | """ |
22 | | - fn = unicodedata.normalize("NFC", unicode(fn, "utf-8")).encode() |
| 22 | + fn = unicodedata.normalize("NFC", fn) |
23 | 23 | return fn |
24 | 24 |
|
25 | 25 | def should_normalize_securecookie(host, name): |
@@ -50,8 +50,8 @@ def should_normalize_securecookie(host, name): |
50 | 50 | name = branch.attrib["name"] |
51 | 51 |
|
52 | 52 | 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)) |
55 | 55 | exit_with_non_zero = True |
56 | 56 | break |
57 | 57 |
|
|
0 commit comments