about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2019-03-14 09:44:22 -0400
committerZack Weinberg <zackw@panix.com>2019-03-14 09:44:22 -0400
commit97f8225d22ef727ae9935cc231643efdc430d530 (patch)
tree8df07ec8a0cbd891c771c23ec3cb95f650b7ab99 /scripts
parent0c1041ee5b2889db7cf8bb75da05117c512b1191 (diff)
downloadglibc-97f8225d22ef727ae9935cc231643efdc430d530.tar.gz
glibc-97f8225d22ef727ae9935cc231643efdc430d530.tar.xz
glibc-97f8225d22ef727ae9935cc231643efdc430d530.zip
scripts/check-obsolete-constructs.py: Process all headers as UTF-8.
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-obsolete-constructs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/check-obsolete-constructs.py b/scripts/check-obsolete-constructs.py
index ce5c72251f..89d21dea6e 100755
--- a/scripts/check-obsolete-constructs.py
+++ b/scripts/check-obsolete-constructs.py
@@ -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))