diff options
Diffstat (limited to 'utils/check-package')
-rwxr-xr-x | utils/check-package | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/check-package b/utils/check-package index 3dbc28b0a2..26439f08eb 100755 --- a/utils/check-package +++ b/utils/check-package @@ -6,6 +6,7 @@ import argparse import inspect import os import re +import six import sys import checkpackagelib.lib_config @@ -127,10 +128,15 @@ def check_file_using_lib(fname): for cf in objects: nwarnings += print_warnings(cf.before()) - for lineno, text in enumerate(open(fname, "r").readlines()): + if six.PY3: + f = open(fname, "r", errors="surrogateescape") + else: + f = open(fname, "r") + for lineno, text in enumerate(f.readlines()): nlines += 1 for cf in objects: nwarnings += print_warnings(cf.check_line(lineno + 1, text)) + f.close() for cf in objects: nwarnings += print_warnings(cf.after()) |