520cc8
commit 97f8225d22ef727ae9935cc231643efdc430d530
520cc8
Author: Zack Weinberg <zackw@panix.com>
520cc8
Date:   Thu Mar 14 09:44:22 2019 -0400
520cc8
520cc8
    scripts/check-obsolete-constructs.py: Process all headers as UTF-8.
520cc8
    
520cc8
    A few of our installed headers contain UTF-8 in comments.
520cc8
    check-obsolete-constructs opened files without explicitly specifying
520cc8
    their encoding, so it would barf on these headers if “make check” was
520cc8
    run in a non-UTF-8 locale.
520cc8
    
520cc8
            * scripts/check-obsolete-constructs.py (HeaderChecker.check):
520cc8
            Specify encoding="utf-8" when opening headers to check.
520cc8
520cc8
diff --git a/scripts/check-obsolete-constructs.py b/scripts/check-obsolete-constructs.py
520cc8
index ce5c72251f4d7cc0..89d21dea6e788783 100755
520cc8
--- a/scripts/check-obsolete-constructs.py
520cc8
+++ b/scripts/check-obsolete-constructs.py
520cc8
@@ -437,7 +437,7 @@ class HeaderChecker:
520cc8
     def check(self, fname):
520cc8
         self.fname = fname
520cc8
         try:
520cc8
-            with open(fname, "rt") as fp:
520cc8
+            with open(fname, "rt", encoding="utf-8") as fp:
520cc8
                 contents = fp.read()
520cc8
         except OSError as e:
520cc8
             sys.stderr.write("{}: {}\n".format(fname, e.strerror))