From patchwork Thu Mar 14 13:49:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zack Weinberg X-Patchwork-Id: 1056527 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-100636-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=panix.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="g8D5n9sQ"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44KqnX0sfcz9s5c for ; Fri, 15 Mar 2019 00:49:19 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=Uh+ 2JGhayQycnsyRDeEvZHnQrJnhUUab6zdC9GVs6z40L6S1qcNMxqK/o1v1oS8Wrsf wj1rzjOQDurqkj/go2AkMH0LY+mWRsmT9BtwkPfcDpl9fahWPmefxBdh/m3up44y vOPJZQZTxCWaE6eAz7V9lDGncaJougU+x2SbTPmM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=HR+ZyYmuH I6qn7hBTQ6EM+WqAwI=; b=g8D5n9sQg60TA+OtCpxUCItJI+HyCS6EeKkK7uMcp XNtp+KeUU62KQxJ8jY6QO2ilaBfzWwErok+3SkJjfBvjXf6OrsvBV6TQmw6mUUIZ AMaBvom04cldjd2c87/Zo2rIP1Wx4g0VJBaICuHhXcZNMJgkWkXWQQ/JGF1xCUxc aU= Received: (qmail 21115 invoked by alias); 14 Mar 2019 13:49:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 21100 invoked by uid 89); 14 Mar 2019 13:49:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=our, HContent-Transfer-Encoding:8bit X-HELO: mailbackend.panix.com From: Zack Weinberg To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] scripts/check-obsolete-constructs.py: Process all headers as UTF-8. Date: Thu, 14 Mar 2019 09:49:11 -0400 Message-Id: <20190314134911.8160-1-zackw@panix.com> MIME-Version: 1.0 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 | 5 +++++ scripts/check-obsolete-constructs.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f2cdcd7a66..f0281e5d10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-03-14 Zack Weinberg + + * scripts/check-obsolete-constructs.py (HeaderChecker.check): + Specify encoding="utf-8" when opening headers to check. + 2019-03-13 Joseph Myers * scripts/build-many-glibcs.py (Context.checkout): Default Linux 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))