]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
scripts/check-obsolete-constructs.py: Process all headers as UTF-8.
authorZack Weinberg <zackw@panix.com>
Thu, 14 Mar 2019 13:44:22 +0000 (09:44 -0400)
committerZack Weinberg <zackw@panix.com>
Thu, 14 Mar 2019 13:44:22 +0000 (09:44 -0400)
A few of our installed headers contain UTF-8 in comments.
check-obsolete-constructs opened files without explicitly specifying
their encoding, so it would barf on these headers if “make check” was
run in a non-UTF-8 locale.

* scripts/check-obsolete-constructs.py (HeaderChecker.check):
Specify encoding="utf-8" when opening headers to check.

ChangeLog
scripts/check-obsolete-constructs.py

index f2cdcd7a667e5dcfd54af441a2da2cd3ed528dd8..f0281e5d10ac9951ac22582caf306240070e770f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-03-14  Zack Weinberg  <zackw@panix.com>
+
+       * scripts/check-obsolete-constructs.py (HeaderChecker.check):
+       Specify encoding="utf-8" when opening headers to check.
+
 2019-03-13  Joseph Myers  <joseph@codesourcery.com>
 
        * scripts/build-many-glibcs.py (Context.checkout): Default Linux
index ce5c72251f4d7cc02d17c307b7bfa0faba2c0384..89d21dea6e788783de1669d7cad645bb7d050e4d 100755 (executable)
@@ -437,7 +437,7 @@ class HeaderChecker:
     def check(self, fname):
         self.fname = fname
         try:
-            with open(fname, "rt") as fp:
+            with open(fname, "rt", encoding="utf-8") as fp:
                 contents = fp.read()
         except OSError as e:
             sys.stderr.write("{}: {}\n".format(fname, e.strerror))