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